What changed, and why it matters
This commit only adds Rust compiler directives to silence warnings about unused macros and imports. It does not change any program behavior, fix a bug, or address a security issue.
No security action required. Treat as a normal build-hygiene or lint-suppression commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch adds #[allow(unused_macros)] and #[allow(unused_imports)] attributes to macro definitions and re-exports in four Rust source files. These attributes suppress rustc/Clippy lint warnings when the macros or imports are not used in every build configuration. There are no functional code changes.
Changed components
core/embed/rust/src/align.rscore/embed/rust/src/error.rscore/embed/rust/src/macros.rscore/embed/rust/src/maybe_trace.rsInspect captured patch +8 / −0
diff --git a/core/embed/rust/src/align.rs b/core/embed/rust/src/align.rs
index 537af5ee..3ca2513c 100644
--- a/core/embed/rust/src/align.rs
+++ b/core/embed/rust/src/align.rs
@@ -6,6 +6,7 @@ pub struct AlignedTo<Align, Bytes: ?Sized> {
pub data: Bytes,
}
+#[allow(unused_macros)]
macro_rules! include_aligned {
($align:ty, $filename:expr) => {{
use $crate::align::AlignedTo;
@@ -18,4 +19,6 @@ macro_rules! include_aligned {
&ALIGNED.data
}};
}
+
+#[allow(unused_imports)]
pub(crate) use include_aligned;
diff --git a/core/embed/rust/src/error.rs b/core/embed/rust/src/error.rs
index 6d04d95a..965eb68b 100644
--- a/core/embed/rust/src/error.rs
+++ b/core/embed/rust/src/error.rs
@@ -28,12 +28,14 @@ pub enum Error {
NotImplementedError,
}
+#[allow(unused_macros)]
macro_rules! value_error {
($msg:expr) => {
$crate::error::Error::ValueError($msg)
};
}
+#[allow(unused_imports)]
pub(crate) use value_error;
#[cfg(feature = "micropython")]
diff --git a/core/embed/rust/src/macros.rs b/core/embed/rust/src/macros.rs
index b7addc86..b6610b9d 100644
--- a/core/embed/rust/src/macros.rs
+++ b/core/embed/rust/src/macros.rs
@@ -8,6 +8,7 @@ macro_rules! unwrap {
};
}
+#[allow(unused_macros)]
macro_rules! ensure {
($what:expr, $error:expr) => {
if !($what) {
@@ -25,6 +26,7 @@ macro_rules! fatal_error {
// from https://docs.rs/ufmt/latest/ufmt/
// like `std::format!` it returns a `heapless::String` but uses `uwrite!`
// instead of `write!`
+#[allow(unused_macros)]
macro_rules! uformat {
// IMPORTANT use `tt` fragments instead of `expr` fragments (i.e. `$($exprs:expr),*`)
(@$type:ty, $($tt:tt)*) => {{
diff --git a/core/embed/rust/src/maybe_trace.rs b/core/embed/rust/src/maybe_trace.rs
index 2eb2a7c8..e1b41349 100644
--- a/core/embed/rust/src/maybe_trace.rs
+++ b/core/embed/rust/src/maybe_trace.rs
@@ -12,4 +12,5 @@ mod maybe_trace_private {
impl<T> MaybeTrace for T {}
}
+#[allow(unused_imports)]
pub use maybe_trace_private::MaybeTrace;
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.