Skip to content

Commit 02af3ca

Browse files
committedJul 8, 2019
Added test explicitly testing that this PR continues to handle empty arrays in same manner as before.
1 parent 02714b8 commit 02af3ca

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Pre-existing behavior has been to reject patterns with consts
2+
// denoting non-empty arrays of non-`Eq` types, but *accept* empty
3+
// arrays of such types.
4+
//
5+
// See rust-lang/rust#62336.
6+
7+
// run-pass
8+
9+
#[derive(PartialEq, Debug)]
10+
struct B(i32);
11+
12+
fn main() {
13+
const FOO: [B; 0] = [];
14+
match [] {
15+
FOO => { }
16+
}
17+
}

0 commit comments

Comments
 (0)