1
Fork 0

there can never be too many tests

This commit is contained in:
Oliver Schneider 2016-06-22 11:11:51 +02:00
parent 3404a9da2a
commit b33a9f3431
No known key found for this signature in database
GPG key ID: 56D6EEA0FC67AC46

View file

@ -0,0 +1,14 @@
#[repr(C)]
pub enum Foo {
A, B, C, D
}
fn main() {
let f = unsafe { std::mem::transmute::<i32, Foo>(42) };
match f {
Foo::A => {}, //~ ERROR invalid enum discriminant value read
Foo::B => {},
Foo::C => {},
Foo::D => {},
}
}