]> git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/const_limit/const_eval_limit_reached.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / consts / const_limit / const_eval_limit_reached.rs
1 #![feature(const_eval_limit)]
2 #![feature(const_loop, const_if_match)]
3
4 #![const_eval_limit="500"]
5
6 const X: usize = {
7 let mut x = 0;
8 while x != 1000 {
9 //~^ ERROR any use of this value will cause an error
10 x += 1;
11 }
12
13 x
14 };
15
16 fn main() {
17 assert_eq!(X, 1000);
18 }