]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.rs
Move const-eval/stable-metric ui tests
[rust.git] / tests / ui / consts / const-eval / stable-metric / ctfe-simple-loop.rs
1 // check-fail
2 // compile-flags: -Z tiny-const-eval-limit
3 const fn simple_loop(n: u32) -> u32 {
4     let mut index = 0;
5     while index < n { //~ ERROR evaluation of constant value failed [E0080]
6         index = index + 1;
7     }
8     0
9 }
10
11 const X: u32 = simple_loop(19);
12
13 fn main() {
14     println!("{X}");
15 }