Files
rust/tests/compile-fail/never_say_never.rs
T
2017-07-19 20:32:51 -07:00

13 lines
231 B
Rust

#![feature(never_type)]
#![allow(unreachable_code)]
fn main() {
let y = &5;
let x: ! = unsafe {
*(y as *const _ as *const !) //~ ERROR tried to access a dead local variable
};
f(x)
}
fn f(x: !) -> ! { x }