@@ -874,11 +874,12 @@ impl<'p, Cx: TypeCx> PatStack<'p, Cx> {
874
874
& self ,
875
875
pcx : & PlaceCtxt < ' _ , ' p , Cx > ,
876
876
ctor : & Constructor < Cx > ,
877
+ ctor_sub_tys : & [ Cx :: Ty ] ,
877
878
ctor_is_relevant : bool ,
878
879
) -> PatStack < ' p , Cx > {
879
880
// We pop the head pattern and push the new fields extracted from the arguments of
880
881
// `self.head()`.
881
- let mut new_pats = self . head ( ) . specialize ( pcx, ctor) ;
882
+ let mut new_pats = self . head ( ) . specialize ( pcx, ctor, ctor_sub_tys ) ;
882
883
new_pats. extend_from_slice ( & self . pats [ 1 ..] ) ;
883
884
// `ctor` is relevant for this row if it is the actual constructor of this row, or if the
884
885
// row has a wildcard and `ctor` is relevant for wildcards.
@@ -950,11 +951,12 @@ impl<'p, Cx: TypeCx> MatrixRow<'p, Cx> {
950
951
& self ,
951
952
pcx : & PlaceCtxt < ' _ , ' p , Cx > ,
952
953
ctor : & Constructor < Cx > ,
954
+ ctor_sub_tys : & [ Cx :: Ty ] ,
953
955
ctor_is_relevant : bool ,
954
956
parent_row : usize ,
955
957
) -> MatrixRow < ' p , Cx > {
956
958
MatrixRow {
957
- pats : self . pats . pop_head_constructor ( pcx, ctor, ctor_is_relevant) ,
959
+ pats : self . pats . pop_head_constructor ( pcx, ctor, ctor_sub_tys , ctor_is_relevant) ,
958
960
parent_row,
959
961
is_under_guard : self . is_under_guard ,
960
962
useful : false ,
@@ -1079,7 +1081,8 @@ impl<'p, Cx: TypeCx> Matrix<'p, Cx> {
1079
1081
} ;
1080
1082
for ( i, row) in self . rows ( ) . enumerate ( ) {
1081
1083
if ctor. is_covered_by ( pcx, row. head ( ) . ctor ( ) ) {
1082
- let new_row = row. pop_head_constructor ( pcx, ctor, ctor_is_relevant, i) ;
1084
+ let new_row =
1085
+ row. pop_head_constructor ( pcx, ctor, ctor_sub_tys, ctor_is_relevant, i) ;
1083
1086
matrix. expand_and_push ( new_row) ;
1084
1087
}
1085
1088
}
0 commit comments