2017-09-22 06:21:30 -05:00
|
|
|
// This should fail even without validation
|
|
|
|
// compile-flags: -Zmir-emit-validate=0
|
|
|
|
|
2017-01-12 02:41:36 -06:00
|
|
|
#![feature(never_type)]
|
|
|
|
#![allow(unreachable_code)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let y = &5;
|
|
|
|
let x: ! = unsafe {
|
2018-07-15 04:21:56 -05:00
|
|
|
*(y as *const _ as *const !) //~ ERROR constant evaluation error
|
2018-05-09 10:45:16 -05:00
|
|
|
//~^ NOTE entered unreachable code
|
2017-01-12 02:41:36 -06:00
|
|
|
};
|
|
|
|
f(x)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn f(x: !) -> ! { x }
|