rust/tests/compile-fail/never_transmute_humans.rs
2019-11-22 09:50:22 +01:00

11 lines
232 B
Rust

// This should fail even without validation
// compile-flags: -Zmiri-disable-validation
struct Human;
fn main() {
let _x: ! = unsafe {
std::mem::transmute::<Human, !>(Human) //~ ERROR entered unreachable code
};
}