]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/never_say_never.rs
Rollup merge of #105459 - jyn514:proc-macro-default, r=Mark-Simulacrum
[rust.git] / src / tools / miri / tests / fail / never_say_never.rs
1 // This should fail even without validation
2 //@compile-flags: -Zmiri-disable-validation
3
4 #![feature(never_type)]
5 #![allow(unreachable_code)]
6
7 fn main() {
8     let y = &5;
9     let x: ! = unsafe {
10         *(y as *const _ as *const !) //~ ERROR: entering unreachable code
11     };
12     f(x)
13 }
14
15 fn f(x: !) -> ! {
16     x
17 }