rust/tests/ui/parser/item-free-static-no-body-semantic-fail.rs

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

12 lines
380 B
Rust
Raw Normal View History

// Semantically, a free `static` item cannot omit its body.
fn main() {}
static A: u8; //~ ERROR free static item without body
static B; //~ ERROR free static item without body
2021-10-06 00:52:45 +00:00
//~^ ERROR missing type for `static` item
static mut C: u8; //~ ERROR free static item without body
static mut D; //~ ERROR free static item without body
2021-10-06 00:52:45 +00:00
//~^ ERROR missing type for `static mut` item