about summary refs log tree commit diff
path: root/src/test/ui/mir_check_nonconst.rs
blob: b8ec0c3c449ff6785be64498a97cbc74d595f56d (plain)
1
2
3
4
5
6
7
8
9
10
11
#![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() {}