@@ -733,12 +733,12 @@ where
733733 // Skip lifetime parameters of the enclosing item(s)
734734 // Also skip the witness type, because that has no free regions.
735735
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 ) {
737737 upvar_ty. visit_with ( self ) ;
738738 }
739739
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 ) ;
742742 }
743743 _ => {
744744 ty. super_visit_with ( self ) ;
@@ -902,7 +902,7 @@ impl TypeFolder<'tcx> for ReverseMapper<'tcx> {
902902 ty:: Generator ( def_id, substs, movability) => {
903903 let generics = self . tcx . generics_of ( def_id) ;
904904 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) | {
906906 if index < generics. parent_count {
907907 // Accommodate missing regions in the parent kinds...
908908 self . fold_kind_mapping_missing_regions_to_empty ( kind)
@@ -912,7 +912,7 @@ impl TypeFolder<'tcx> for ReverseMapper<'tcx> {
912912 }
913913 } ) ) ;
914914
915- self . tcx . mk_generator ( def_id, ty :: GeneratorSubsts { substs } , movability)
915+ self . tcx . mk_generator ( def_id, substs, movability)
916916 }
917917
918918 ty:: Param ( ..) => {
0 commit comments