rust/tests/ui/consts/mir_check_nonconst.rs

12 lines
156 B
Rust
Raw Normal View History

2018-04-17 10:59:27 -05:00
#![allow(dead_code)]
struct Foo { a: u8 }
fn bar() -> Foo {
Foo { a: 5 }
}
static foo: Foo = bar();
2021-12-09 11:10:05 -06:00
//~^ ERROR cannot call non-const fn
2018-04-17 10:59:27 -05:00
fn main() {}