rust/tests/compile-fail/never_transmute_humans.rs
2018-12-02 11:26:09 +01:00

14 lines
301 B
Rust

// This should fail even without validation
// compile-flags: -Zmiri-disable-validation
#![feature(never_type)]
struct Human;
fn main() {
let _x: ! = unsafe {
std::mem::transmute::<Human, !>(Human) //~ ERROR constant evaluation error
//^~ NOTE entered unreachable code
};
}