hashes: mark deprecation on cpufeatures macro
What changed, and why it matters
This commit is a routine code cleanup. It changes the compiler warning suppression attribute from `#[allow(deprecated_in_future)]` to `#[allow(deprecated)]` because the upstream `cpufeatures` crate now triggers a current `deprecated` warning instead of a future one. There is no security bug being fixed and no behavior change to the program.
No security action required. Treat as normal maintenance; ensure CI uses a compatible Rust toolchain if warnings are denied.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch updates four module-level attributes in hashes/src/sha256/crypto/mod.rs. The cpufeatures::new! macro internally calls u8::max_value(), which has been reclassified from a future deprecation to an active deprecation on newer Rust nightlies. The commit replaces #[allow(deprecated_in_future)] with #[allow(deprecated)] and removes/updates explanatory comments. The compiled output and runtime behavior are unchanged.
Changed components
hashes/src/sha256/crypto/mod.rsInspect captured patch +5 / −6
### hashes/src/sha256/crypto/mod.rs
@@ -27,32 +27,31 @@ use super::{HashEngine, Midstate, BLOCK_SIZE};
#[cfg(feature = "cpufeatures")]
#[cfg(target_arch = "aarch64")]
-// cpufeatures crate internally uses `u8::max_value()` which will be deprecated.
+// cpufeatures crate internally uses deprecated `u8::max_value()`.
// See: https://docs.rs/cpufeatures/0.2.17/src/cpufeatures/lib.rs.html#161
-#[allow(deprecated_in_future)]
+#[allow(deprecated)]
mod cpuid_sha256_aarch64 {
cpufeatures::new!(inner, "sha2");
pub fn get() -> bool { inner::get() }
}
#[cfg(feature = "cpufeatures")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
-// cpufeatures crate internally uses `u8::max_value()` which will be deprecated.
// See: https://docs.rs/cpufeatures/0.2.17/src/cpufeatures/lib.rs.html#161
-#[allow(deprecated_in_future)]
+#[allow(deprecated)]
mod cpuid_sha256_x86 {
cpufeatures::new!(inner, "sha", "sse2", "ssse3", "sse4.1");
pub fn get() -> bool { inner::get() }
}
#[cfg(feature = "cpufeatures")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
-#[allow(deprecated_in_future)]
+#[allow(deprecated)]
mod cpuid_sse41_x86 {
cpufeatures::new!(inner, "sse2", "ssse3", "sse4.1");
pub fn get() -> bool { inner::get() }
}
#[cfg(feature = "cpufeatures")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
-#[allow(deprecated_in_future)]
+#[allow(deprecated)]
mod cpuid_avx2_x86 {
cpufeatures::new!(inner, "avx", "avx2");
pub fn get() -> bool { inner::get() }Why this scored 20/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.