2017-09-22 06:21:30 -05:00
|
|
|
// This should fail even without validation
|
2018-10-24 10:17:44 -05:00
|
|
|
// compile-flags: -Zmiri-disable-validation
|
2017-09-22 06:21:30 -05:00
|
|
|
|
2019-12-15 05:22:09 -06:00
|
|
|
#![feature(never_type)]
|
2017-01-12 02:41:36 -06:00
|
|
|
#![allow(unreachable_code)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let y = &5;
|
|
|
|
let x: ! = unsafe {
|
2022-06-21 01:40:39 -05:00
|
|
|
*(y as *const _ as *const !) //~ ERROR entering unreachable code
|
2017-01-12 02:41:36 -06:00
|
|
|
};
|
|
|
|
f(x)
|
|
|
|
}
|
|
|
|
|
2022-06-21 01:40:39 -05:00
|
|
|
fn f(x: !) -> ! {
|
|
|
|
x
|
|
|
|
}
|