2019-12-14 11:51:56 -06:00
|
|
|
#![feature(const_eval_limit)]
|
|
|
|
#![const_eval_limit="18_446_744_073_709_551_615"]
|
2020-02-19 03:24:16 -06:00
|
|
|
//~^ ERROR `limit` must be a non-negative integer
|
2019-12-13 02:38:07 -06:00
|
|
|
|
|
|
|
const CONSTANT: usize = limit();
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
assert_eq!(CONSTANT, 1764);
|
|
|
|
}
|
|
|
|
|
|
|
|
const fn limit() -> usize {
|
|
|
|
let x = 42;
|
|
|
|
|
|
|
|
x * 42
|
|
|
|
}
|