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