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 14:49:38 -05:00
#![const_eval_limit = "500"]
2020-03-17 18:08:28 -05:00
const X: usize = {
let mut x = 0;
while x != 1000 {
2022-09-21 06:05:20 -05:00
//~^ ERROR evaluation of constant value failed
2020-03-17 18:08:28 -05:00
x += 1;
}
2020-03-17 18:08:28 -05:00
x
};
2020-03-17 18:08:28 -05:00
fn main() {
assert_eq!(X, 1000);
}