mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
20 lines
630 B
Rust
20 lines
630 B
Rust
#![feature(never_type)]
|
|
#![deny(uninhabited_static)]
|
|
|
|
enum Void {}
|
|
extern {
|
|
static VOID: Void; //~ ERROR static of uninhabited type
|
|
//~| WARN: previously accepted
|
|
static NEVER: !; //~ ERROR static of uninhabited type
|
|
//~| WARN: previously accepted
|
|
}
|
|
|
|
static VOID2: Void = unsafe { std::mem::transmute(()) }; //~ ERROR static of uninhabited type
|
|
//~| WARN: previously accepted
|
|
//~| ERROR could not evaluate static initializer
|
|
static NEVER2: Void = unsafe { std::mem::transmute(()) }; //~ ERROR static of uninhabited type
|
|
//~| WARN: previously accepted
|
|
//~| ERROR could not evaluate static initializer
|
|
|
|
fn main() {}
|