rust/tests/ui/consts/const_limit/const_eval_limit_reached.rs
2023-01-11 09:32:08 +00:00

17 lines
247 B
Rust

#![feature(const_eval_limit)]
#![const_eval_limit = "500"]
const X: usize = {
let mut x = 0;
while x != 1000 {
//~^ ERROR evaluation of constant value failed
x += 1;
}
x
};
fn main() {
assert_eq!(X, 1000);
}