]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/packed_pattern2.rs
Rollup merge of #106873 - BoxyUwU:ty_const_formatting, r=compiler-errors
[rust.git] / tests / ui / consts / packed_pattern2.rs
1 // run-pass
2
3 #[derive(PartialEq, Eq, Copy, Clone)]
4 #[repr(packed)]
5 struct Foo {
6     field: (u8, u16),
7 }
8
9 #[derive(PartialEq, Eq, Copy, Clone)]
10 #[repr(align(2))]
11 struct Bar {
12     a: Foo,
13 }
14
15 const FOO: Bar = Bar {
16     a: Foo {
17         field: (5, 6),
18     }
19 };
20
21 fn main() {
22     match FOO {
23         Bar { a: Foo { field: (5, 6) } } => {},
24         FOO => unreachable!(), //~ WARNING unreachable pattern
25         _ => unreachable!(),
26     }
27 }