Closed
Description
Working on #6993 specifically on #12179 raised the fact that break
and continue
use Name
as opposed of Ident
. This was introduced in #9103 and unfortunately this change seems to have made them non-hygienic.
An example taken from @huonw comment:
#[feature(macro_rules)];
macro_rules! foo {
($e: expr) => {
// $e shouldn't be able to interact with this 'x
'x: loop { $e }
}
}
fn main() {
'x: loop {
// i.e. this 'x should refer to the outer loop, but may be "captured"
// by the 'x declaration inside foo
foo!(break 'x);
println!("should not be printed")
}
}
Presumably, reverting the change should make them hygienic again.
I volunteer as a mentor for this fix.