mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
21 lines
353 B
Rust
21 lines
353 B
Rust
//@ check-pass
|
|
//@ compile-flags: -Zextra-const-ub-checks
|
|
|
|
#[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!(),
|
|
}
|
|
}
|