]> git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/miri_unleashed/non_const_fn.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / consts / miri_unleashed / non_const_fn.rs
1 // compile-flags: -Zunleash-the-miri-inside-of-you
2
3 // A test demonstrating that we prevent calling non-const fn during CTFE.
4
5 fn foo() {}
6
7 static C: () = foo();
8 //~^ ERROR could not evaluate static initializer
9 //~| NOTE calling non-const function `foo`
10
11 fn main() {}