@@ -702,8 +702,8 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
702
702
703
703
let mut remapped_types = DefIdMap :: default ( ) ;
704
704
for ( def_id, ( ty, args) ) in collected_types {
705
- match infcx. fully_resolve ( ( ty , args ) ) {
706
- Ok ( ( ty , args ) ) => {
705
+ match infcx. fully_resolve ( ty ) {
706
+ Ok ( ty ) => {
707
707
// `ty` contains free regions that we created earlier while liberating the
708
708
// trait fn signature. However, projection normalization expects `ty` to
709
709
// contains `def_id`'s early-bound regions.
@@ -883,22 +883,6 @@ impl<'tcx> ty::FallibleTypeFolder<TyCtxt<'tcx>> for RemapHiddenTyRegions<'tcx> {
883
883
self . tcx
884
884
}
885
885
886
- fn try_fold_ty ( & mut self , t : Ty < ' tcx > ) -> Result < Ty < ' tcx > , Self :: Error > {
887
- if let ty:: Alias ( ty:: Opaque , ty:: AliasTy { args, def_id, .. } ) = * t. kind ( ) {
888
- let mut mapped_args = Vec :: with_capacity ( args. len ( ) ) ;
889
- for ( arg, v) in std:: iter:: zip ( args, self . tcx . variances_of ( def_id) ) {
890
- mapped_args. push ( match ( arg. unpack ( ) , v) {
891
- // Skip uncaptured opaque args
892
- ( ty:: GenericArgKind :: Lifetime ( _) , ty:: Bivariant ) => arg,
893
- _ => arg. try_fold_with ( self ) ?,
894
- } ) ;
895
- }
896
- Ok ( Ty :: new_opaque ( self . tcx , def_id, self . tcx . mk_args ( & mapped_args) ) )
897
- } else {
898
- t. try_super_fold_with ( self )
899
- }
900
- }
901
-
902
886
fn try_fold_region (
903
887
& mut self ,
904
888
region : ty:: Region < ' tcx > ,
0 commit comments