gccrs
gccrs copied to clipboard
Macro expansion of attribute-bearing statement treated as expression
I tried this code:
macro_rules! mac {
() => {
#[allow(overflowing_literals)]
match () {_ => {}}
}
}
pub fn foo() {
mac!()
}
I expected to see this happen: no error
Instead, this happened:
test.rs:3:9: error: found unexpected token ‘#’ in null denotation
3 | #[allow(overflowing_literals)]
| ^
Meta
- sha:
1b322540fa0fce561cf86e371dd7f304f1343511
@powerboat9 if you'd like to work on this, this is probably caused by a missing call to parse_outer_attributes in the macro transcribers. I'm thinking that the fix should not be too hard, but maybe I am downplaying it in my head