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

15 lines
284 B
Rust

// This should fail even without validation
// compile-flags: -Zmiri-disable-validation
#![allow(unreachable_code)]
fn main() {
let y = &5;
let x: ! = unsafe {
*(y as *const _ as *const !) //~ ERROR entered unreachable code
};
f(x)
}
fn f(x: !) -> ! { x }