2017-09-22 13:21:30 +02:00
|
|
|
// This should fail even without validation
|
2018-10-24 17:17:44 +02:00
|
|
|
// compile-flags: -Zmiri-disable-validation
|
2017-09-22 13:21:30 +02:00
|
|
|
|
2019-12-15 12:22:09 +01:00
|
|
|
#![feature(never_type)]
|
2019-08-18 11:16:02 +02:00
|
|
|
#![allow(unused, invalid_value)]
|
2017-01-12 11:23:44 +01:00
|
|
|
|
|
|
|
enum Void {}
|
|
|
|
|
|
|
|
fn f(v: Void) -> ! {
|
2020-03-30 20:15:02 +02:00
|
|
|
match v {} //~ ERROR entering unreachable code
|
2017-01-12 11:23:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let v: Void = unsafe {
|
2017-09-22 13:21:30 +02:00
|
|
|
std::mem::transmute::<(), Void>(())
|
2017-01-12 11:23:44 +01:00
|
|
|
};
|
2020-03-30 20:15:02 +02:00
|
|
|
f(v); //~ inside `main`
|
2017-01-12 11:23:44 +01:00
|
|
|
}
|