Files
rust/tests/ui/mir/enum/with_niche_int_break.rs
Bastian Kersting b4e68e212e Respect endianness correctly in CheckEnums test suite
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.
2025-07-07 17:58:44 +02:00

22 lines
345 B
Rust

//@ run-fail
//@ compile-flags: -C debug-assertions
//@ error-pattern: trying to construct an enum from an invalid value
#[allow(dead_code)]
#[repr(u16)]
enum Mix {
A,
B(u16),
}
#[allow(dead_code)]
enum Nested {
C(Mix),
D,
E,
}
fn main() {
let _val: Nested = unsafe { std::mem::transmute::<u32, Nested>(u32::MAX) };
}