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
|
|
|
const fn simple_loop(n: u32) -> u32 {
|
|
|
|
let mut index = 0;
|
2022-12-29 17:14:29 -06:00
|
|
|
while index < n { //~ ERROR evaluation of constant value failed [E0080]
|
2022-12-19 18:51:17 -06:00
|
|
|
index = index + 1;
|
|
|
|
}
|
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 = simple_loop(19);
|
2022-12-19 18:51:17 -06:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
println!("{X}");
|
|
|
|
}
|