blob: 84fa2c29739012cd8d498639bd5103d8621e9985 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
// Validation makes this fail in the wrong place
// Make sure we find these even with many checks disabled.
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
use std::mem;
#[repr(C)]
pub enum Foo {
A,
B,
C,
D,
}
fn main() {
let f = unsafe { std::mem::transmute::<i32, Foo>(42) };
let _val = mem::discriminant(&f); //~ERROR: enum value has invalid tag
}
|