about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2019-07-08 13:40:08 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2019-07-08 13:40:08 +0200
commit02af3ca5c42f35eeceb0761180193a6abb97c0ad (patch)
tree27adc85d793d3acec342991f20e5fb9de7f775a4
parent02714b8ba3424fdfa1513fc893bb692472834a59 (diff)
Added test explicitly testing that this PR continues to handle empty arrays in same manner as before.
-rw-r--r--src/test/ui/rfc1445/match-empty-array-allowed-without-eq-issue-62336.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/rfc1445/match-empty-array-allowed-without-eq-issue-62336.rs b/src/test/ui/rfc1445/match-empty-array-allowed-without-eq-issue-62336.rs
new file mode 100644
index 00000000000..7ba0f3a9e8d
--- /dev/null
+++ b/src/test/ui/rfc1445/match-empty-array-allowed-without-eq-issue-62336.rs
@@ -0,0 +1,17 @@
+// Pre-existing behavior has been to reject patterns with consts
+// denoting non-empty arrays of non-`Eq` types, but *accept* empty
+// arrays of such types.
+//
+// See rust-lang/rust#62336.
+
+// run-pass
+
+#[derive(PartialEq, Debug)]
+struct B(i32);
+
+fn main() {
+    const FOO: [B; 0] = [];
+    match [] {
+        FOO => { }
+    }
+}