blob: ca0eec93c5dac5ddbe945fa9a5eea2a90bf8133d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
// check-fail
// compile-flags: -Z tiny-const-eval-limit
const fn simple_loop(n: u32) -> u32 {
let mut index = 0;
while index < n { //~ ERROR evaluation of constant value failed [E0080]
index = index + 1;
}
0
}
const X: u32 = simple_loop(19);
fn main() {
println!("{X}");
}
|