rust/tests/ui/consts/const-eval/stable-metric/ctfe-fn-call.rs
2024-02-16 20:02:50 +00:00

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}");
}