rust/tests/ui/consts/miri_unleashed/non_const_fn.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
268 B
Rust
Raw Normal View History

2019-10-19 06:13:31 -05:00
// compile-flags: -Zunleash-the-miri-inside-of-you
2019-10-19 06:13:31 -05:00
// A test demonstrating that we prevent calling non-const fn during CTFE.
fn foo() {}
2020-05-03 07:23:08 -05:00
static C: () = foo();
//~^ ERROR could not evaluate static initializer
//~| NOTE calling non-const function `foo`
2019-10-19 06:13:31 -05:00
fn main() {}