2018-05-09 10:30:16 -05:00
|
|
|
// This should fail even without validation
|
2018-05-09 10:45:16 -05:00
|
|
|
// ignore-test causes rustc ICE: rust-lang/rust#50570
|
2018-05-09 10:30:16 -05:00
|
|
|
// compile-flags: -Zmir-emit-validate=0
|
|
|
|
|
|
|
|
#![feature(never_type)]
|
|
|
|
#![allow(unreachable_code)]
|
|
|
|
#![allow(unused_variables)]
|
|
|
|
|
|
|
|
struct Human;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x: ! = unsafe {
|
|
|
|
std::mem::transmute::<Human, !>(Human) //~ ERROR entered unreachable code
|
|
|
|
};
|
|
|
|
f(x)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn f(x: !) -> ! { x }
|