]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-1445-restrict-constants-in-patterns/match-empty-array-allowed-without-eq-issue-62336.rs
Rollup merge of #99064 - lyming2007:issue-97687-fix, r=estebank
[rust.git] / src / test / ui / rfc-1445-restrict-constants-in-patterns / match-empty-array-allowed-without-eq-issue-62336.rs
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 }