2017-08-02 17:35:44 -05:00
|
|
|
// Validation makes this fail in the wrong place
|
|
|
|
// compile-flags: -Zmir-emit-validate=0
|
|
|
|
|
2016-06-22 04:11:51 -05:00
|
|
|
#[repr(C)]
|
|
|
|
pub enum Foo {
|
|
|
|
A, B, C, D
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let f = unsafe { std::mem::transmute::<i32, Foo>(42) };
|
|
|
|
match f {
|
2018-05-09 10:45:16 -05:00
|
|
|
Foo::A => {},
|
2016-06-22 04:11:51 -05:00
|
|
|
Foo::B => {},
|
|
|
|
Foo::C => {},
|
|
|
|
Foo::D => {},
|
|
|
|
}
|
2018-05-09 10:45:16 -05:00
|
|
|
} //~ ERROR constant evaluation error [E0080]
|
|
|
|
//~^ NOTE entered unreachable code
|