2017-09-22 13:21:30 +02:00
|
|
|
// This should fail even without validation
|
2022-07-08 16:08:32 +00:00
|
|
|
//@compile-flags: -Zmiri-disable-validation
|
2022-07-11 11:44:55 +00:00
|
|
|
//@require-annotations-for-level: ERROR
|
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
|
|
|
|
2022-04-20 17:41:09 -04:00
|
|
|
mod m {
|
|
|
|
enum VoidI {}
|
|
|
|
pub struct Void(VoidI);
|
2017-01-12 11:23:44 +01:00
|
|
|
|
2022-04-20 17:41:09 -04:00
|
|
|
pub fn f(v: Void) -> ! {
|
2022-07-11 11:44:55 +00:00
|
|
|
match v.0 {} //~ ERROR: entering unreachable code
|
2022-04-20 17:41:09 -04:00
|
|
|
}
|
2017-01-12 11:23:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2022-06-20 23:40:39 -07:00
|
|
|
let v = unsafe { std::mem::transmute::<(), m::Void>(()) };
|
2022-07-11 11:44:55 +00:00
|
|
|
m::f(v); //~ NOTE: inside `main`
|
2017-01-12 11:23:44 +01:00
|
|
|
}
|