rust/tests/compile-fail/never_say_never.rs
2017-01-12 09:41:36 +01:00

13 lines
218 B
Rust

#![feature(never_type)]
#![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 }