2018-05-09 17:30:16 +02:00
|
|
|
// This should fail even without validation
|
2022-07-08 16:08:32 +00:00
|
|
|
//@compile-flags: -Zmiri-disable-validation
|
2018-05-09 17:30:16 +02:00
|
|
|
|
2019-12-15 12:22:09 +01:00
|
|
|
#![feature(never_type)]
|
|
|
|
|
2018-05-09 17:30:16 +02:00
|
|
|
struct Human;
|
|
|
|
|
|
|
|
fn main() {
|
2018-12-02 11:26:09 +01:00
|
|
|
let _x: ! = unsafe {
|
2022-07-11 11:44:55 +00:00
|
|
|
std::mem::transmute::<Human, !>(Human) //~ ERROR: transmuting to uninhabited
|
2018-05-09 17:30:16 +02:00
|
|
|
};
|
|
|
|
}
|