2 #![allow(unreachable_code)]
3 #![allow(unused_labels)]
4 // Test that labels injected by macros do not break hygiene.
6 // Issue #24278: The label/lifetime shadowing checker from #24162
7 // conservatively ignores hygiene, and thus issues warnings that are
8 // both true- and false-positives for this test.
12 // $e shouldn't be able to interact with this 'x
19 macro_rules! run_once {
28 macro_rules! while_x {
31 'x: while 1 + 1 == 2 {
39 // this 'x should refer to the outer loop, lexically
41 panic!("break doesn't act hygienically inside for loop");
47 panic!("break doesn't act hygienically inside infinite loop");
50 'x: while 1 + 1 == 2 {
52 panic!("break doesn't act hygienically inside infinite while loop");
57 run_once!(continue 'x);
58 panic!("continue doesn't act hygienically inside for loop");