Closed
Description
The following should print 1
, but it currently prints 0
:
fn main() {
let x = 0;
macro_rules! foo { () => {
let x = 1;
macro_rules! bar { () => {x} }
println!("{}", bar!());
}}
foo! {};
}
For comparison, the following correctly prints 1
:
fn main() {
let x = 0;
macro_rules! foo { () => {{ //< note the added brace here
let x = 1;
macro_rules! bar { () => {x} }
println!("{}", bar!());
}}}
foo! {};
}
Metadata
Metadata
Assignees
Labels
No labels