I am really confused
⚓ Rust 📅 2026-03-24 👤 surdeus 👁️ 1if we go to this page
we will see this structure
BlockExpression →
{
InnerAttribute*
Statements?
}
Statements →
Statement+
| Statement+ ExpressionWithoutBlock
| ExpressionWithoutBlock
but it is impossible to put an attribute such #![allow(unused_variables)] inside a macro like this
macro_rules! show_block {
($b:block) => {
println!("Result: {}", $b);
};
}
fn main() {
show_block!({
#![allow(unused_assignments)]
});
}
are attributes not meant to be used with macros ????
then why is the reference mentioning them ????
BlockExpression →
{
InnerAttribute*
Statements?
}
it says inner and then statement am i reading it correctly ????
i followed this link
and click on blockexpression
here * block: a BlockExpression
2 posts - 2 participants
🏷️ Rust_feed