rust/tests/ui/consts/const-eval/stable-metric/ctfe-fn-call.rs

37 lines
444 B
Rust
Raw Normal View History

// check-fail
// compile-flags: -Z tiny-const-eval-limit
2022-12-28 21:38:34 -06:00
const fn foo() {}
const fn call_foo() -> u32 {
foo();
foo();
foo();
foo();
foo();
2022-12-28 21:38:34 -06:00
foo();
foo();
foo();
foo();
foo();
2022-12-28 21:38:34 -06:00
foo();
foo();
foo();
foo();
foo();
2022-12-28 21:38:34 -06:00
foo();
foo();
foo();
foo(); //~ ERROR evaluation of constant value failed [E0080]
2022-12-28 21:38:34 -06:00
0
}
const X: u32 = call_foo();
fn main() {
println!("{X}");
}