The endianness can change the test expectation for the enum check. This change is fixing the failing tests on big endian by changing the tests so that they behave the same as on little endian.
22 lines
377 B
Rust
22 lines
377 B
Rust
//@ run-fail
|
|
//@ compile-flags: -C debug-assertions
|
|
//@ error-pattern: trying to construct an enum from an invalid value
|
|
|
|
#[allow(dead_code)]
|
|
#[repr(u32)]
|
|
enum Foo {
|
|
A,
|
|
B,
|
|
}
|
|
|
|
#[allow(dead_code)]
|
|
struct Bar {
|
|
a: u32,
|
|
b: u32,
|
|
}
|
|
|
|
fn main() {
|
|
let _val: Option<(u32, Foo)> =
|
|
unsafe { std::mem::transmute::<_, Option<(u32, Foo)>>(Bar { a: 3, b: 3 }) };
|
|
}
|