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

16 lines
270 B
Rust

#![feature(const_eval_limit)]
#![const_eval_limit="18_446_744_073_709_551_615"]
//~^ ERROR `limit` must be a non-negative integer
const CONSTANT: usize = limit();
fn main() {
assert_eq!(CONSTANT, 1764);
}
const fn limit() -> usize {
let x = 42;
x * 42
}