about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2022-07-26 15:10:39 -0700
committerMichael Howell <michael@notriddle.com>2022-07-26 15:33:04 -0700
commit4443fd5d76c6c28bb5954463ee35daf4ee508d81 (patch)
tree4e6a91f88462e3af166ec258213b028573b75303
parentc11207ec89b856164bba03b8ecfe07b0b234ed21 (diff)
downloadrust-4443fd5d76c6c28bb5954463ee35daf4ee508d81.tar.gz
rust-4443fd5d76c6c28bb5954463ee35daf4ee508d81.zip
rustdoc: remove Clean trait impl for ProjectionTy
-rw-r--r--src/librustdoc/clean/mod.rs19
1 files changed, 10 insertions, 9 deletions
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<DefId>, 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)))