os-rust/tests/ui/consts/mir_check_nonconst.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
156 B
Rust
Raw Normal View History

2018-04-17 18:59:27 +03:00
#![allow(dead_code)]
struct Foo { a: u8 }
fn bar() -> Foo {
Foo { a: 5 }
}
static foo: Foo = bar();
2021-12-10 01:10:05 +08:00
//~^ ERROR cannot call non-const fn
2018-04-17 18:59:27 +03:00
fn main() {}