]> git.lizzy.rs Git - rust.git/blob - tests/fail/never_transmute_humans.rs
Auto merge of #2422 - RalfJung:integers, r=oli-obk
[rust.git] / 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 }