2017-09-22 06:21:30 -05:00
|
|
|
// This should fail even without validation
|
2018-10-12 03:54:37 -05:00
|
|
|
// compile-flags: -Zmir-emit-validate=0 -Zmiri-disable-validation
|
2017-09-22 06:21:30 -05:00
|
|
|
|
2017-01-12 04:23:44 -06:00
|
|
|
#![feature(never_type)]
|
|
|
|
#![allow(unreachable_code)]
|
|
|
|
#![allow(unused_variables)]
|
|
|
|
|
|
|
|
enum Void {}
|
|
|
|
|
|
|
|
fn f(v: Void) -> ! {
|
2018-07-15 04:21:56 -05:00
|
|
|
match v {} //~ ERROR constant evaluation error
|
2018-05-09 10:45:16 -05:00
|
|
|
//~^ NOTE entered unreachable code
|
2017-01-12 04:23:44 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let v: Void = unsafe {
|
2017-09-22 06:21:30 -05:00
|
|
|
std::mem::transmute::<(), Void>(())
|
2017-01-12 04:23:44 -06:00
|
|
|
};
|
2018-05-09 10:45:16 -05:00
|
|
|
f(v); //~ inside call to `f`
|
2017-01-12 04:23:44 -06:00
|
|
|
}
|