blob: ad67b4446165c0b9b2f04e41e5d9c971268db17d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// This should fail even without validation
//@compile-flags: -Zmiri-disable-validation
//@require-annotations-for-level: ERROR
#![feature(never_type)]
#![allow(unused, invalid_value)]
mod m {
enum VoidI {}
pub struct Void(VoidI);
pub fn f(v: Void) -> ! {
match v.0 {}
//~^ ERROR: entering unreachable code
}
}
fn main() {
let v = unsafe { std::mem::transmute::<(), m::Void>(()) };
m::f(v);
//~^ NOTE: inside `main`
}
|