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