]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const_limit/feature-gate-const_eval_limit.rs
Rollup merge of #70038 - DutchGhost:const-forget-tests, r=RalfJung
[rust.git] / src / test / ui / consts / const_limit / feature-gate-const_eval_limit.rs
1 #![const_eval_limit="42"]
2 //~^ ERROR the `#[const_eval_limit]` attribute is an experimental feature [E0658]
3
4 const CONSTANT: usize = limit();
5
6 fn main() {
7     assert_eq!(CONSTANT, 1764);
8 }
9
10 const fn limit() -> usize {
11     let x = 42;
12
13     x * 42
14 }