]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/never_transmute_void.rs
adjust stacktrace printing to rustc changes
[rust.git] / tests / compile-fail / never_transmute_void.rs
1 // This should fail even without validation
2 // compile-flags: -Zmiri-disable-validation
3
4 #![feature(never_type)]
5 #![allow(unused, invalid_value)]
6
7 enum Void {}
8
9 fn f(v: Void) -> ! {
10     match v {} //~ ERROR entering unreachable code
11 }
12
13 fn main() {
14     let v: Void = unsafe {
15         std::mem::transmute::<(), Void>(())
16     };
17     f(v); //~ inside `main`
18 }