]> git.lizzy.rs Git - rust.git/commitdiff
rustdoc: Remove unused Clean impls
authorJoshua Nelson <jyn514@gmail.com>
Mon, 5 Jul 2021 15:40:03 +0000 (11:40 -0400)
committerJoshua Nelson <jyn514@gmail.com>
Mon, 5 Jul 2021 15:53:05 +0000 (11:53 -0400)
src/librustdoc/clean/blanket_impl.rs
src/librustdoc/clean/mod.rs

index 3f2fae1aca33b30eeb654d6f77a68721c27b075a..dc60b5a1d58e1624604c15079a20d7354be46b4b 100644 (file)
@@ -98,7 +98,7 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
                     visibility: Inherited,
                     def_id: FakeDefId::new_fake(item_def_id.krate),
                     kind: box ImplItem(Impl {
-                        span: self.cx.tcx.def_span(impl_def_id).clean(self.cx),
+                        span: Span::from_rustc_span(self.cx.tcx.def_span(impl_def_id)),
                         unsafety: hir::Unsafety::Normal,
                         generics: (
                             self.cx.tcx.generics_of(impl_def_id),
index cc086427dd0cd09032a3e98bce63fa277fa99c90..767b14135bdfa550e558dbeea04c8b062141e3dd 100644 (file)
@@ -227,20 +227,6 @@ fn clean(&self, cx: &mut DocContext<'_>) -> GenericBound {
     }
 }
 
-impl<'tcx> Clean<Option<Vec<GenericBound>>> for InternalSubsts<'tcx> {
-    fn clean(&self, cx: &mut DocContext<'_>) -> Option<Vec<GenericBound>> {
-        let mut v = Vec::new();
-        v.extend(self.regions().filter_map(|r| r.clean(cx)).map(GenericBound::Outlives));
-        v.extend(self.types().map(|t| {
-            GenericBound::TraitBound(
-                PolyTrait { trait_: t.clean(cx), generic_params: Vec::new() },
-                hir::TraitBoundModifier::None,
-            )
-        }));
-        if !v.is_empty() { Some(v) } else { None }
-    }
-}
-
 impl Clean<Lifetime> for hir::Lifetime {
     fn clean(&self, cx: &mut DocContext<'_>) -> Lifetime {
         let def = cx.tcx.named_region(self.hir_id);
@@ -296,12 +282,6 @@ fn clean(&self, cx: &mut DocContext<'_>) -> Constant {
     }
 }
 
-impl Clean<Lifetime> for ty::GenericParamDef {
-    fn clean(&self, _cx: &mut DocContext<'_>) -> Lifetime {
-        Lifetime(self.name)
-    }
-}
-
 impl Clean<Option<Lifetime>> for ty::RegionKind {
     fn clean(&self, _cx: &mut DocContext<'_>) -> Option<Lifetime> {
         match *self {
@@ -1764,12 +1744,6 @@ fn clean(&self, cx: &mut DocContext<'_>) -> Variant {
     }
 }
 
-impl Clean<Span> for rustc_span::Span {
-    fn clean(&self, _cx: &mut DocContext<'_>) -> Span {
-        Span::from_rustc_span(*self)
-    }
-}
-
 impl Clean<Path> for hir::Path<'_> {
     fn clean(&self, cx: &mut DocContext<'_>) -> Path {
         Path {
@@ -2211,22 +2185,3 @@ fn clean(&self, cx: &mut DocContext<'_>) -> TypeBindingKind {
         }
     }
 }
-
-enum SimpleBound {
-    TraitBound(Vec<PathSegment>, Vec<SimpleBound>, Vec<GenericParamDef>, hir::TraitBoundModifier),
-    Outlives(Lifetime),
-}
-
-impl From<GenericBound> for SimpleBound {
-    fn from(bound: GenericBound) -> Self {
-        match bound.clone() {
-            GenericBound::Outlives(l) => SimpleBound::Outlives(l),
-            GenericBound::TraitBound(t, mod_) => match t.trait_ {
-                Type::ResolvedPath { path, .. } => {
-                    SimpleBound::TraitBound(path.segments, Vec::new(), t.generic_params, mod_)
-                }
-                _ => panic!("Unexpected bound {:?}", bound),
-            },
-        }
-    }
-}