@@ -791,10 +791,10 @@ fn clean_ty_generics<'tcx>(
791791 } )
792792 . collect :: < ThinVec < GenericParamDef > > ( ) ;
793793
794- // param index -> [(trait DefId, associated type name & generics, type , higher-ranked params)]
794+ // param index -> [(trait DefId, associated type name & generics, term , higher-ranked params)]
795795 let mut impl_trait_proj = FxHashMap :: <
796796 u32 ,
797- Vec < ( DefId , PathSegment , ty:: Binder < ' _ , Ty < ' _ > > , Vec < GenericParamDef > ) > ,
797+ Vec < ( DefId , PathSegment , ty:: Binder < ' _ , ty :: Term < ' _ > > , Vec < GenericParamDef > ) > ,
798798 > :: default ( ) ;
799799
800800 let where_predicates = preds
@@ -852,11 +852,10 @@ fn clean_ty_generics<'tcx>(
852852 . as_ref ( )
853853 . and_then ( |( lhs, rhs) : & ( Type , _ ) | Some ( ( lhs. projection ( ) ?, rhs) ) )
854854 {
855- // FIXME(...): Remove this unwrap()
856855 impl_trait_proj. entry ( param_idx) . or_default ( ) . push ( (
857856 trait_did,
858857 name,
859- rhs. map_bound ( |rhs| rhs . ty ( ) . unwrap ( ) ) ,
858+ * rhs,
860859 p. get_bound_params ( )
861860 . into_iter ( )
862861 . flatten ( )
@@ -879,15 +878,8 @@ fn clean_ty_generics<'tcx>(
879878 let crate :: core:: ImplTraitParam :: ParamIndex ( idx) = param else { unreachable ! ( ) } ;
880879 if let Some ( proj) = impl_trait_proj. remove ( & idx) {
881880 for ( trait_did, name, rhs, bound_params) in proj {
882- let rhs = clean_middle_ty ( rhs, cx, None , None ) ;
883- simplify:: merge_bounds (
884- cx,
885- & mut bounds,
886- bound_params,
887- trait_did,
888- name,
889- & Term :: Type ( rhs) ,
890- ) ;
881+ let rhs = clean_middle_term ( rhs, cx) ;
882+ simplify:: merge_bounds ( cx, & mut bounds, bound_params, trait_did, name, & rhs) ;
891883 }
892884 }
893885
0 commit comments