hashes: fix tag name in sha256t_tag macro docs
What changed, and why it matters
This is a one-word documentation fix in a Rust macro. The generated documentation for a cryptographic tag structure was accidentally referring to a non-existent variable name, so it displayed broken placeholder text like '[`$hash_name`]' instead of the actual tag name. The change makes the docs show the correct tag name. There is no code behavior change and no security impact.
No security action needed. Treat as a normal documentation fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In hashes/src/macros.rs, the sha256t_tag! macro invoked sha256t_tag_struct! with stringify!($hash_name), but the macro’s pattern binds the identifier as $tag, not $hash_name. This caused every generated tag’s rustdoc to contain the literal unsubstituted ‘$hash_name’. The patch changes the argument to stringify!($tag), which correctly stringifies the actual tag identifier for documentation purposes. The rest of the macro expansion, including the impl block and MIDSTATE constant, is unchanged.
Changed components
hashes/src/macros.rssha256t_tag! macro documentationInspect captured patch +1 / −1
diff --git a/hashes/src/macros.rs b/hashes/src/macros.rs
index 2b8e7b73..b8dd7e28 100644
--- a/hashes/src/macros.rs
+++ b/hashes/src/macros.rs
@@ -31,7 +31,7 @@
#[macro_export]
macro_rules! sha256t_tag {
($(#[$($tag_attr:tt)*])* $tag_vis:vis struct $tag:ident = $constructor:tt($($tag_value:tt)+);) => {
- $crate::sha256t_tag_struct!($tag_vis, $tag, stringify!($hash_name), $(#[$($tag_attr)*])*);
+ $crate::sha256t_tag_struct!($tag_vis, $tag, stringify!($tag), $(#[$($tag_attr)*])*);
impl $crate::sha256t::Tag for $tag {
const MIDSTATE: $crate::sha256::Midstate = $crate::sha256t_tag_constructor!($constructor, $($tag_value)+);
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.