Skip to content
Permalink
Browse files

Added test explicitly testing that this PR continues to handle empty …

…arrays in same manner as before.
  • Loading branch information...
pnkfelix committed Jul 8, 2019
1 parent 02714b8 commit 02af3ca5c42f35eeceb0761180193a6abb97c0ad
Showing with 17 additions and 0 deletions.
  1. +17 −0 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 => { }
}
}

0 comments on commit 02af3ca

Please sign in to comment.
You can’t perform that action at this time.