Added test explicitly testing that this PR continues to handle empty arrays in same manner as before.
This commit is contained in:
parent
02714b8ba3
commit
02af3ca5c4
1 changed files with 17 additions and 0 deletions
|
@ -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 => { }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue