Correctly handle nested or-patterns in column-wise analyses
This commit is contained in:
parent
9d6d5d4894
commit
d5e836cf0c
@ -931,7 +931,7 @@ impl<'p, 'tcx> PatternColumn<'p, 'tcx> {
|
||||
let specialized = pat.specialize(pcx, &ctor);
|
||||
for (subpat, column) in specialized.iter().zip(&mut specialized_columns) {
|
||||
if subpat.is_or_pat() {
|
||||
column.patterns.extend(subpat.iter_fields())
|
||||
column.patterns.extend(subpat.flatten_or_pat())
|
||||
} else {
|
||||
column.patterns.push(subpat)
|
||||
}
|
||||
|
@ -35,4 +35,10 @@ fn main() {
|
||||
((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…
x
Reference in New Issue
Block a user