rust/src/test/ui/mir_check_nonconst.rs
2018-12-25 21:08:33 -07:00

12 lines
216 B
Rust

#![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() {}