@@ -398,12 +398,10 @@ fn clean_type_outlives_predicate<'tcx>(
398398 } )
399399}
400400
401- impl < ' tcx > Clean < ' tcx , Term > for ty:: Term < ' tcx > {
402- fn clean ( & self , cx : & mut DocContext < ' tcx > ) -> Term {
403- match self {
404- ty:: Term :: Ty ( ty) => Term :: Type ( clean_middle_ty ( * ty, cx, None ) ) ,
405- ty:: Term :: Const ( c) => Term :: Constant ( clean_middle_const ( * c, cx) ) ,
406- }
401+ fn clean_middle_term < ' tcx > ( term : ty:: Term < ' tcx > , cx : & mut DocContext < ' tcx > ) -> Term {
402+ match term {
403+ ty:: Term :: Ty ( ty) => Term :: Type ( clean_middle_ty ( ty, cx, None ) ) ,
404+ ty:: Term :: Const ( c) => Term :: Constant ( clean_middle_const ( c, cx) ) ,
407405 }
408406}
409407
@@ -426,7 +424,7 @@ fn clean_projection_predicate<'tcx>(
426424 let ty:: ProjectionPredicate { projection_ty, term } = pred;
427425 WherePredicate :: EqPredicate {
428426 lhs : clean_projection ( projection_ty, cx, None ) ,
429- rhs : term . clean ( cx) ,
427+ rhs : clean_middle_term ( term , cx) ,
430428 }
431429}
432430
@@ -1682,7 +1680,9 @@ pub(crate) fn clean_middle_ty<'tcx>(
16821680 . projection_ty ,
16831681 cx,
16841682 ) ,
1685- kind : TypeBindingKind :: Equality { term : pb. skip_binder ( ) . term . clean ( cx) } ,
1683+ kind : TypeBindingKind :: Equality {
1684+ term : clean_middle_term ( pb. skip_binder ( ) . term , cx) ,
1685+ } ,
16861686 } ) ;
16871687 }
16881688
@@ -1746,7 +1746,7 @@ pub(crate) fn clean_middle_ty<'tcx>(
17461746 Some ( TypeBinding {
17471747 assoc : projection_to_path_segment ( proj. projection_ty , cx) ,
17481748 kind : TypeBindingKind :: Equality {
1749- term : proj. term . clean ( cx) ,
1749+ term : clean_middle_term ( proj. term , cx) ,
17501750 } ,
17511751 } )
17521752 } else {
0 commit comments