summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/packed_pattern.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/consts/packed_pattern.rs')
-rw-r--r--src/test/ui/consts/packed_pattern.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/consts/packed_pattern.rs b/src/test/ui/consts/packed_pattern.rs
new file mode 100644
index 000000000..370fec6fb
--- /dev/null
+++ b/src/test/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!(),
+ }
+}