2022-12-29 17:14:29 -06:00
|
|
|
// check-fail
|
|
|
|
// compile-flags: -Z tiny-const-eval-limit
|
2022-12-19 18:51:17 -06:00
|
|
|
|
2022-12-29 17:14:29 -06:00
|
|
|
const fn labelled_loop(n: u32) -> u32 {
|
|
|
|
let mut i = 0;
|
2022-11-02 06:57:40 -05:00
|
|
|
'mylabel: loop {
|
|
|
|
//~^ ERROR is taking a long time
|
2022-12-29 17:14:29 -06:00
|
|
|
if i > n {
|
2022-11-02 06:57:40 -05:00
|
|
|
break 'mylabel;
|
2022-12-19 18:51:17 -06:00
|
|
|
}
|
2022-12-29 17:14:29 -06:00
|
|
|
i += 1;
|
2022-12-19 18:51:17 -06:00
|
|
|
}
|
2022-12-29 17:14:29 -06:00
|
|
|
0
|
2022-12-19 18:51:17 -06:00
|
|
|
}
|
|
|
|
|
2022-12-29 17:14:29 -06:00
|
|
|
const X: u32 = labelled_loop(19);
|
2022-12-19 18:51:17 -06:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
println!("{X}");
|
|
|
|
}
|