2017-09-22 13:21:30 +02:00
|
|
|
// This should fail even without validation
|
|
|
|
// compile-flags: -Zmir-emit-validate=0
|
|
|
|
|
2017-01-12 09:41:36 +01:00
|
|
|
#![feature(never_type)]
|
|
|
|
#![allow(unreachable_code)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let y = &5;
|
|
|
|
let x: ! = unsafe {
|
2017-07-19 20:32:51 -07:00
|
|
|
*(y as *const _ as *const !) //~ ERROR tried to access a dead local variable
|
2017-01-12 09:41:36 +01:00
|
|
|
};
|
|
|
|
f(x)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn f(x: !) -> ! { x }
|