1
Fork 0

Added test explicitly testing that this PR continues to handle empty arrays in same manner as before.

This commit is contained in:
Felix S. Klock II 2019-07-08 13:40:08 +02:00
parent 02714b8ba3
commit 02af3ca5c4

View file

@ -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 => { }
}
}