@@ -791,10 +791,10 @@ fn clean_ty_generics<'tcx>(
791
791
} )
792
792
. collect :: < ThinVec < GenericParamDef > > ( ) ;
793
793
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)]
795
795
let mut impl_trait_proj = FxHashMap :: <
796
796
u32 ,
797
- Vec < ( DefId , PathSegment , ty:: Binder < ' _ , Ty < ' _ > > , Vec < GenericParamDef > ) > ,
797
+ Vec < ( DefId , PathSegment , ty:: Binder < ' _ , ty :: Term < ' _ > > , Vec < GenericParamDef > ) > ,
798
798
> :: default ( ) ;
799
799
800
800
let where_predicates = preds
@@ -852,11 +852,10 @@ fn clean_ty_generics<'tcx>(
852
852
. as_ref ( )
853
853
. and_then ( |( lhs, rhs) : & ( Type , _ ) | Some ( ( lhs. projection ( ) ?, rhs) ) )
854
854
{
855
- // FIXME(...): Remove this unwrap()
856
855
impl_trait_proj. entry ( param_idx) . or_default ( ) . push ( (
857
856
trait_did,
858
857
name,
859
- rhs. map_bound ( |rhs| rhs . ty ( ) . unwrap ( ) ) ,
858
+ * rhs,
860
859
p. get_bound_params ( )
861
860
. into_iter ( )
862
861
. flatten ( )
@@ -879,15 +878,8 @@ fn clean_ty_generics<'tcx>(
879
878
let crate :: core:: ImplTraitParam :: ParamIndex ( idx) = param else { unreachable ! ( ) } ;
880
879
if let Some ( proj) = impl_trait_proj. remove ( & idx) {
881
880
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) ;
891
883
}
892
884
}
893
885
0 commit comments