rust/src/test/ui/mir_check_nonconst.rs

12 lines
216 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();
//~^ ERROR calls in statics are limited to constant functions, tuple structs and tuple variants
fn main() {}