hashes: silence new `unused-assignments` clippy lint
What changed, and why it matters
This commit is a code-quality cleanup, not a security fix. It adds a `let _ = w[15];` line in two SHA hashing implementation files solely to silence a new Rust clippy lint about an unused assignment inside a macro on the final round of SHA-256 and SHA-512. The generated machine code and behavior are unchanged.
No security action needed; treat as a normal lint-silencing cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change suppresses the unused-assignments/unnecessary assignment clippy lint that appears on recent nightly compilers. The round! macro assigns to $w, and on the last invocation that assignment is never read. Adding let _ = w[15]; makes the compiler consider the value used, without affecting logic or generated code. No cryptographic constants, operations, or control flow are modified.
Changed components
hashes/src/sha256/crypto.rshashes/src/sha512/crypto.rsInspect captured patch +2 / −0
diff --git a/hashes/src/sha256/crypto.rs b/hashes/src/sha256/crypto.rs
index f85e0ec9..905a5848 100644
--- a/hashes/src/sha256/crypto.rs
+++ b/hashes/src/sha256/crypto.rs
@@ -608,6 +608,7 @@ impl HashEngine {
round!(d, e, f, g, h, a, b, c, 0xa4506ceb, w[13], w[11], w[6], w[14]);
round!(c, d, e, f, g, h, a, b, 0xbef9a3f7, w[14], w[12], w[7], w[15]);
round!(b, c, d, e, f, g, h, a, 0xc67178f2, w[15], w[13], w[8], w[0]);
+ let _ = w[15]; // silence "unnecessary assignment" lint in macro
self.h[0] = self.h[0].wrapping_add(a);
self.h[1] = self.h[1].wrapping_add(b);
diff --git a/hashes/src/sha512/crypto.rs b/hashes/src/sha512/crypto.rs
index 6bf4f5ce..a86d962e 100644
--- a/hashes/src/sha512/crypto.rs
+++ b/hashes/src/sha512/crypto.rs
@@ -174,6 +174,7 @@ impl HashEngine {
round!(d, e, f, g, h, a, b, c, 0x597f299cfc657e2a, w[13], w[11], w[6], w[14]);
round!(c, d, e, f, g, h, a, b, 0x5fcb6fab3ad6faec, w[14], w[12], w[7], w[15]);
round!(b, c, d, e, f, g, h, a, 0x6c44198c4a475817, w[15], w[13], w[8], w[0]);
+ let _ = w[15]; // silence "unnecessary assignment" lint in macro
self.h[0] = self.h[0].wrapping_add(a);
self.h[1] = self.h[1].wrapping_add(b);
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.