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

15 lines
248 B
Rust

#![const_eval_limit="42"]
//~^ ERROR the `#[const_eval_limit]` attribute is an experimental feature [E0658]
const CONSTANT: usize = limit();
fn main() {
assert_eq!(CONSTANT, 1764);
}
const fn limit() -> usize {
let x = 42;
x * 42
}