@@ -405,14 +405,12 @@ fn clean_middle_term<'tcx>(term: ty::Term<'tcx>, cx: &mut DocContext<'tcx>) -> T
405405 }
406406}
407407
408- impl < ' tcx > Clean < ' tcx , Term > for hir:: Term < ' tcx > {
409- fn clean ( & self , cx : & mut DocContext < ' tcx > ) -> Term {
410- match self {
411- hir:: Term :: Ty ( ty) => Term :: Type ( clean_ty ( ty, cx) ) ,
412- hir:: Term :: Const ( c) => {
413- let def_id = cx. tcx . hir ( ) . local_def_id ( c. hir_id ) ;
414- Term :: Constant ( clean_middle_const ( ty:: Const :: from_anon_const ( cx. tcx , def_id) , cx) )
415- }
408+ fn clean_hir_term < ' tcx > ( term : & hir:: Term < ' tcx > , cx : & mut DocContext < ' tcx > ) -> Term {
409+ match term {
410+ hir:: Term :: Ty ( ty) => Term :: Type ( clean_ty ( ty, cx) ) ,
411+ hir:: Term :: Const ( c) => {
412+ let def_id = cx. tcx . hir ( ) . local_def_id ( c. hir_id ) ;
413+ Term :: Constant ( clean_middle_const ( ty:: Const :: from_anon_const ( cx. tcx , def_id) , cx) )
416414 }
417415 }
418416}
@@ -2283,7 +2281,7 @@ impl<'tcx> Clean<'tcx, TypeBindingKind> for hir::TypeBindingKind<'tcx> {
22832281 fn clean ( & self , cx : & mut DocContext < ' tcx > ) -> TypeBindingKind {
22842282 match * self {
22852283 hir:: TypeBindingKind :: Equality { ref term } => {
2286- TypeBindingKind :: Equality { term : term . clean ( cx) }
2284+ TypeBindingKind :: Equality { term : clean_hir_term ( term , cx) }
22872285 }
22882286 hir:: TypeBindingKind :: Constraint { bounds } => TypeBindingKind :: Constraint {
22892287 bounds : bounds. iter ( ) . filter_map ( |b| b. clean ( cx) ) . collect ( ) ,
0 commit comments