2020-10-24 09:13:39 -05: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 09:01:32 -05:00
|
|
|
static VOID2: Void = unsafe { std::mem::transmute(()) }; //~ ERROR static of uninhabited type
|
|
|
|
//~| WARN: previously accepted
|
2022-01-24 18:00:00 -06:00
|
|
|
//~| ERROR could not evaluate static initializer
|
2021-07-20 22:23:22 -05:00
|
|
|
//~| WARN: type `Void` does not permit zero-initialization
|
2020-10-25 09:01:32 -05:00
|
|
|
static NEVER2: Void = unsafe { std::mem::transmute(()) }; //~ ERROR static of uninhabited type
|
|
|
|
//~| WARN: previously accepted
|
2022-01-24 18:00:00 -06:00
|
|
|
//~| ERROR could not evaluate static initializer
|
2021-07-20 22:23:22 -05:00
|
|
|
//~| WARN: type `Void` does not permit zero-initialization
|
2020-10-25 09:01:32 -05:00
|
|
|
|
2020-10-24 09:13:39 -05:00
|
|
|
fn main() {}
|