]> git.proxmox.com Git - rustc.git/blob - tests/ui/consts/extra-const-ub/issue-100771.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / consts / extra-const-ub / issue-100771.rs
1 // check-pass
2 // compile-flags: -Zextra-const-ub-checks
3
4 #[derive(PartialEq, Eq, Copy, Clone)]
5 #[repr(packed)]
6 struct Foo {
7 field: (i64, u32, u32, u32),
8 }
9
10 const FOO: Foo = Foo {
11 field: (5, 6, 7, 8),
12 };
13
14 fn main() {
15 match FOO {
16 Foo { field: (5, 6, 7, 8) } => {},
17 FOO => unreachable!(),
18 _ => unreachable!(),
19 }
20 }