What changed, and why it matters
This is a minor code-quality change. A constant used only in tests that require the 'alloc' feature was not itself behind that feature gate, causing a compiler warning (Clippy lint) when building without that feature. The patch adds the missing feature gate so the constant is only compiled when needed. There is no security impact.
No security action needed. Treat as normal maintenance/CI hygiene.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In hashes/src/sha256/tests.rs, the const TAP_LEAF_MIDSTATE is referenced only by an alloc-gated test. Without #[cfg(feature = “alloc”)], building tests without the alloc feature produces an unused-const warning. The commit adds the cfg attribute to suppress the lint. No logic, API, or cryptographic behavior changes.
Changed components
hashes/src/sha256/tests.rsInspect captured patch +1 / −0
diff --git a/hashes/src/sha256/tests.rs b/hashes/src/sha256/tests.rs
index faf0f520..7ee0c84f 100644
--- a/hashes/src/sha256/tests.rs
+++ b/hashes/src/sha256/tests.rs
@@ -178,6 +178,7 @@ fn hash_unoptimized() {
}
// The midstate of an empty hash engine tagged with "TapLeaf".
+#[cfg(feature = "alloc")]
const TAP_LEAF_MIDSTATE: Midstate = Midstate::new(
[
156, 224, 228, 230, 124, 17, 108, 57, 56, 179, 202, 242, 195, 15, 80, 137, 211, 243, 147,
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.