2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2018-08-31 15:02:01 +02:00
|
|
|
#![allow(stable_features)]
|
2019-11-12 03:19:40 -08:00
|
|
|
#![allow(unused_labels)]
|
2017-12-20 15:37:22 -05:00
|
|
|
#![allow(unreachable_code)]
|
|
|
|
|
|
|
|
macro_rules! x {
|
|
|
|
($a:lifetime) => {
|
|
|
|
$a: loop {
|
|
|
|
break $a;
|
|
|
|
panic!("failed");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
macro_rules! br {
|
|
|
|
($a:lifetime) => {
|
|
|
|
break $a;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
macro_rules! br2 {
|
|
|
|
($b:lifetime) => {
|
2021-12-08 22:40:16 +01:00
|
|
|
'b: loop {
|
2017-12-20 15:37:22 -05:00
|
|
|
break $b; // this $b should refer to the outer loop.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fn main() {
|
|
|
|
x!('a);
|
|
|
|
'c: loop {
|
|
|
|
br!('c);
|
|
|
|
panic!("failed");
|
|
|
|
}
|
|
|
|
'b: loop {
|
|
|
|
br2!('b);
|
|
|
|
panic!("failed");
|
|
|
|
}
|
|
|
|
}
|