]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/extra-const-ub/issue-100771.rs
fix ICE with extra-const-ub-checks
[rust.git] / src / test / 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 }