@@ -733,12 +733,12 @@ where
733
733
// Skip lifetime parameters of the enclosing item(s)
734
734
// Also skip the witness type, because that has no free regions.
735
735
736
- for upvar_ty in substs. upvar_tys ( def_id, self . tcx ) {
736
+ for upvar_ty in substs. as_generator ( ) . upvar_tys ( def_id, self . tcx ) {
737
737
upvar_ty. visit_with ( self ) ;
738
738
}
739
739
740
- substs. return_ty ( def_id, self . tcx ) . visit_with ( self ) ;
741
- substs. yield_ty ( def_id, self . tcx ) . visit_with ( self ) ;
740
+ substs. as_generator ( ) . return_ty ( def_id, self . tcx ) . visit_with ( self ) ;
741
+ substs. as_generator ( ) . yield_ty ( def_id, self . tcx ) . visit_with ( self ) ;
742
742
}
743
743
_ => {
744
744
ty. super_visit_with ( self ) ;
@@ -902,7 +902,7 @@ impl TypeFolder<'tcx> for ReverseMapper<'tcx> {
902
902
ty:: Generator ( def_id, substs, movability) => {
903
903
let generics = self . tcx . generics_of ( def_id) ;
904
904
let substs =
905
- self . tcx . mk_substs ( substs. substs . iter ( ) . enumerate ( ) . map ( |( index, & kind) | {
905
+ self . tcx . mk_substs ( substs. iter ( ) . enumerate ( ) . map ( |( index, & kind) | {
906
906
if index < generics. parent_count {
907
907
// Accommodate missing regions in the parent kinds...
908
908
self . fold_kind_mapping_missing_regions_to_empty ( kind)
@@ -912,7 +912,7 @@ impl TypeFolder<'tcx> for ReverseMapper<'tcx> {
912
912
}
913
913
} ) ) ;
914
914
915
- self . tcx . mk_generator ( def_id, ty :: GeneratorSubsts { substs } , movability)
915
+ self . tcx . mk_generator ( def_id, substs, movability)
916
916
}
917
917
918
918
ty:: Param ( ..) => {
0 commit comments