Correctly handle nested or-patterns in column-wise analyses
This commit is contained in:
parent
9d6d5d4894
commit
d5e836cf0c
2 changed files with 7 additions and 1 deletions
|
@ -931,7 +931,7 @@ impl<'p, 'tcx> PatternColumn<'p, 'tcx> {
|
||||||
let specialized = pat.specialize(pcx, &ctor);
|
let specialized = pat.specialize(pcx, &ctor);
|
||||||
for (subpat, column) in specialized.iter().zip(&mut specialized_columns) {
|
for (subpat, column) in specialized.iter().zip(&mut specialized_columns) {
|
||||||
if subpat.is_or_pat() {
|
if subpat.is_or_pat() {
|
||||||
column.patterns.extend(subpat.iter_fields())
|
column.patterns.extend(subpat.flatten_or_pat())
|
||||||
} else {
|
} else {
|
||||||
column.patterns.push(subpat)
|
column.patterns.push(subpat)
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,4 +35,10 @@ fn main() {
|
||||||
((0, 0) | (1, 0),) => {}
|
((0, 0) | (1, 0),) => {}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This one caused ICE https://github.com/rust-lang/rust/issues/117378
|
||||||
|
match (0u8, 0) {
|
||||||
|
(x @ 0 | x @ (1 | 2), _) => {}
|
||||||
|
(3.., _) => {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue