summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/mir_check_nonconst.rs
blob: b6f34b922fae51548a3956459853637246e7a67a (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 cannot call non-const fn

fn main() {}