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

37 lines
424 B
Rust

//@ check-fail
//@ compile-flags: -Z tiny-const-eval-limit
const fn foo() {}
const fn call_foo() -> u32 {
foo();
foo();
foo();
foo();
foo();
foo();
foo();
foo();
foo();
foo();
foo();
foo();
foo();
foo();
foo();
foo();
foo();
foo();
foo(); //~ ERROR is taking a long time
0
}
const X: u32 = call_foo();
fn main() {
println!("{X}");
}