rust/tests/ui/consts/const_limit/const_eval_limit_reached.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
247 B
Rust
Raw Normal View History

#![feature(const_eval_limit)]
2020-05-21 12:49:38 -07:00
#![const_eval_limit = "500"]
2020-03-17 16:08:28 -07:00
const X: usize = {
let mut x = 0;
while x != 1000 {
2022-09-21 13:05:20 +02:00
//~^ ERROR evaluation of constant value failed
2020-03-17 16:08:28 -07:00
x += 1;
}
2020-03-17 16:08:28 -07:00
x
};
2020-03-17 16:08:28 -07:00
fn main() {
assert_eq!(X, 1000);
}