diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 07237438a0d..a9141b5f451 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -421,7 +421,10 @@ impl<'tcx> Clean<'tcx, Term> for hir::Term<'tcx> { impl<'tcx> Clean<'tcx, WherePredicate> for ty::ProjectionPredicate<'tcx> { fn clean(&self, cx: &mut DocContext<'tcx>) -> WherePredicate { let ty::ProjectionPredicate { projection_ty, term } = self; - WherePredicate::EqPredicate { lhs: projection_ty.clean(cx), rhs: term.clean(cx) } + WherePredicate::EqPredicate { + lhs: clean_projection(*projection_ty, cx, None), + rhs: term.clean(cx), + } } } @@ -447,12 +450,6 @@ fn clean_projection<'tcx>( } } -impl<'tcx> Clean<'tcx, Type> for ty::ProjectionTy<'tcx> { - fn clean(&self, cx: &mut DocContext<'tcx>) -> Type { - clean_projection(*self, cx, None) - } -} - fn compute_should_show_cast(self_def_id: Option, trait_: &Path, self_type: &Type) -> bool { !trait_.segments.is_empty() && self_def_id @@ -734,8 +731,12 @@ fn clean_ty_generics<'tcx>( .filter(|b| !b.is_sized_bound(cx)), ); - let proj = projection - .map(|p| (p.skip_binder().projection_ty.clean(cx), p.skip_binder().term)); + let proj = projection.map(|p| { + ( + clean_projection(p.skip_binder().projection_ty, cx, None), + p.skip_binder().term, + ) + }); if let Some(((_, trait_did, name), rhs)) = proj .as_ref() .and_then(|(lhs, rhs): &(Type, _)| Some((lhs.projection()?, rhs)))