]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/never_transmute_humans.rs
Merge commit '2bb3996244cf1b89878da9e39841e9f6bf061602' into sync_cg_clif-2022-12-14
[rust.git] / src / tools / miri / tests / fail / never_transmute_humans.rs
1 // This should fail even without validation
2 //@compile-flags: -Zmiri-disable-validation
3
4 #![feature(never_type)]
5
6 struct Human;
7
8 fn main() {
9     let _x: ! = unsafe {
10         std::mem::transmute::<Human, !>(Human) //~ ERROR: transmuting to uninhabited
11     };
12 }