2024-02-16 14:02:50 -06:00
|
|
|
//@ check-pass
|
|
|
|
//@ compile-flags: -Zextra-const-ub-checks
|
2022-08-21 19:00:38 -05:00
|
|
|
|
|
|
|
#[derive(PartialEq, Eq, Copy, Clone)]
|
|
|
|
#[repr(packed)]
|
|
|
|
struct Foo {
|
|
|
|
field: (i64, u32, u32, u32),
|
|
|
|
}
|
|
|
|
|
|
|
|
const FOO: Foo = Foo {
|
|
|
|
field: (5, 6, 7, 8),
|
|
|
|
};
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
match FOO {
|
|
|
|
Foo { field: (5, 6, 7, 8) } => {},
|
|
|
|
FOO => unreachable!(),
|
|
|
|
_ => unreachable!(),
|
|
|
|
}
|
|
|
|
}
|