@@ -874,11 +874,12 @@ impl<'p, Cx: TypeCx> PatStack<'p, Cx> {
874874 & self ,
875875 pcx : & PlaceCtxt < ' _ , ' p , Cx > ,
876876 ctor : & Constructor < Cx > ,
877+ ctor_sub_tys : & [ Cx :: Ty ] ,
877878 ctor_is_relevant : bool ,
878879 ) -> PatStack < ' p , Cx > {
879880 // We pop the head pattern and push the new fields extracted from the arguments of
880881 // `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 ) ;
882883 new_pats. extend_from_slice ( & self . pats [ 1 ..] ) ;
883884 // `ctor` is relevant for this row if it is the actual constructor of this row, or if the
884885 // row has a wildcard and `ctor` is relevant for wildcards.
@@ -950,11 +951,12 @@ impl<'p, Cx: TypeCx> MatrixRow<'p, Cx> {
950951 & self ,
951952 pcx : & PlaceCtxt < ' _ , ' p , Cx > ,
952953 ctor : & Constructor < Cx > ,
954+ ctor_sub_tys : & [ Cx :: Ty ] ,
953955 ctor_is_relevant : bool ,
954956 parent_row : usize ,
955957 ) -> MatrixRow < ' p , Cx > {
956958 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) ,
958960 parent_row,
959961 is_under_guard : self . is_under_guard ,
960962 useful : false ,
@@ -1079,7 +1081,8 @@ impl<'p, Cx: TypeCx> Matrix<'p, Cx> {
10791081 } ;
10801082 for ( i, row) in self . rows ( ) . enumerate ( ) {
10811083 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) ;
10831086 matrix. expand_and_push ( new_row) ;
10841087 }
10851088 }
0 commit comments