rust/tests/compile-fail/never_say_never.rs
2019-12-08 01:45:41 +01:00

15 lines
285 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 entering unreachable code
};
f(x)
}
fn f(x: !) -> ! { x }