]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-eval/stable-metric/ctfe-fn-call.rs
Rollup merge of #107146 - compiler-errors:unsizing-params, r=cjgillot
[rust.git] / tests / ui / consts / const-eval / stable-metric / ctfe-fn-call.rs
1 // check-fail
2 // compile-flags: -Z tiny-const-eval-limit
3
4 const fn foo() {}
5
6 const fn call_foo() -> u32 {
7     foo();
8     foo();
9     foo();
10     foo();
11     foo();
12
13     foo();
14     foo();
15     foo();
16     foo();
17     foo();
18
19     foo();
20     foo();
21     foo();
22     foo();
23     foo();
24
25     foo();
26     foo();
27     foo();
28     foo(); //~ ERROR evaluation of constant value failed [E0080]
29     0
30 }
31
32 const X: u32 = call_foo();
33
34 fn main() {
35     println!("{X}");
36 }