diff options
Diffstat (limited to 'tests/ui/consts/packed_pattern.rs')
-rw-r--r-- | tests/ui/consts/packed_pattern.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/consts/packed_pattern.rs b/tests/ui/consts/packed_pattern.rs new file mode 100644 index 000000000..370fec6fb --- /dev/null +++ b/tests/ui/consts/packed_pattern.rs @@ -0,0 +1,19 @@ +// run-pass + +#[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!(), //~ WARNING unreachable pattern + _ => unreachable!(), + } +} |