@@ -398,12 +398,10 @@ fn clean_type_outlives_predicate<'tcx>(
398
398
} )
399
399
}
400
400
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) ) ,
407
405
}
408
406
}
409
407
@@ -426,7 +424,7 @@ fn clean_projection_predicate<'tcx>(
426
424
let ty:: ProjectionPredicate { projection_ty, term } = pred;
427
425
WherePredicate :: EqPredicate {
428
426
lhs : clean_projection ( projection_ty, cx, None ) ,
429
- rhs : term . clean ( cx) ,
427
+ rhs : clean_middle_term ( term , cx) ,
430
428
}
431
429
}
432
430
@@ -1682,7 +1680,9 @@ pub(crate) fn clean_middle_ty<'tcx>(
1682
1680
. projection_ty ,
1683
1681
cx,
1684
1682
) ,
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
+ } ,
1686
1686
} ) ;
1687
1687
}
1688
1688
@@ -1746,7 +1746,7 @@ pub(crate) fn clean_middle_ty<'tcx>(
1746
1746
Some ( TypeBinding {
1747
1747
assoc : projection_to_path_segment ( proj. projection_ty , cx) ,
1748
1748
kind : TypeBindingKind :: Equality {
1749
- term : proj. term . clean ( cx) ,
1749
+ term : clean_middle_term ( proj. term , cx) ,
1750
1750
} ,
1751
1751
} )
1752
1752
} else {
0 commit comments