We only need the arity of the subtype list now

This commit is contained in:
Nadrieril 2024-01-03 01:25:32 +01:00
parent 4ae2840e84
commit 1a3edc169b
3 changed files with 13 additions and 18 deletions

View file

@ -88,9 +88,8 @@ impl<'p, 'tcx> PatternColumn<'p, 'tcx> {
(0..arity).map(|_| Self { patterns: Vec::new() }).collect();
let relevant_patterns =
self.patterns.iter().filter(|pat| ctor.is_covered_by(pcx, pat.ctor()));
let ctor_sub_tys = pcx.ctor_sub_tys(ctor);
for pat in relevant_patterns {
let specialized = pat.specialize(pcx, ctor, ctor_sub_tys);
let specialized = pat.specialize(ctor, arity);
for (subpat, column) in specialized.into_iter().zip(&mut specialized_columns) {
column.expand_and_push(subpat);
}