about summary refs log tree commit diff
path: root/tests/ui/consts/mir_check_nonconst.rs
blob: eede36bd6ed816df662228bb9b85b06b5b8e9159 (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 function

fn main() {}