2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2018-08-31 08:02:01 -05:00
|
|
|
#![allow(stable_features)]
|
2019-11-12 05:19:40 -06:00
|
|
|
#![allow(unused_labels)]
|
2017-12-20 14:37:22 -06: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 15:40:16 -06:00
|
|
|
'b: loop {
|
2017-12-20 14:37:22 -06: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");
|
|
|
|
}
|
|
|
|
}
|