diff options
Diffstat (limited to 'tests/ui/consts/const_limit/const_eval_limit_reached.rs')
-rw-r--r-- | tests/ui/consts/const_limit/const_eval_limit_reached.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/consts/const_limit/const_eval_limit_reached.rs b/tests/ui/consts/const_limit/const_eval_limit_reached.rs new file mode 100644 index 000000000..3ce038c1d --- /dev/null +++ b/tests/ui/consts/const_limit/const_eval_limit_reached.rs @@ -0,0 +1,16 @@ +#![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); +} |