mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-30 06:43:20 +03:00
b4e68e212e
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.
20 lines
328 B
Rust
20 lines
328 B
Rust
//@ run-pass
|
|
//@ compile-flags: -C debug-assertions
|
|
|
|
#[allow(dead_code)]
|
|
#[repr(u32)]
|
|
enum Foo {
|
|
A,
|
|
B,
|
|
}
|
|
|
|
#[allow(dead_code)]
|
|
struct Bar {
|
|
a: u32,
|
|
}
|
|
|
|
fn main() {
|
|
let _val: Foo = unsafe { std::mem::transmute::<_, Foo>(Bar { a: 0 }) };
|
|
let _val: Foo = unsafe { std::mem::transmute::<_, Foo>(Bar { a: 1 }) };
|
|
}
|