2020-10-24 14:13:39 +00:00
|
|
|
#![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
|
|
|
|
}
|
|
|
|
|
2020-10-25 14:01:32 +00:00
|
|
|
static VOID2: Void = unsafe { std::mem::transmute(()) }; //~ ERROR static of uninhabited type
|
|
|
|
//~| WARN: previously accepted
|
2022-01-25 00:00:00 +00:00
|
|
|
//~| ERROR could not evaluate static initializer
|
2020-10-25 14:01:32 +00:00
|
|
|
static NEVER2: Void = unsafe { std::mem::transmute(()) }; //~ ERROR static of uninhabited type
|
|
|
|
//~| WARN: previously accepted
|
2022-01-25 00:00:00 +00:00
|
|
|
//~| ERROR could not evaluate static initializer
|
2020-10-25 14:01:32 +00:00
|
|
|
|
2020-10-24 14:13:39 +00:00
|
|
|
fn main() {}
|