diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2021-07-13 08:54:31 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-13 08:54:31 +0900 |
| commit | a49927350f658c0f4ba517529fec59052b1eed1e (patch) | |
| tree | c61e9be1bda4c4f224ea4bdd0038e4d4de50f0a5 | |
| parent | bcacfe7c64cc294551f8520c1f48dfbbb52a028b (diff) | |
| parent | b0e8b7ddf7e583e964c77476cca95dbe6ea61a1c (diff) | |
| download | rust-a49927350f658c0f4ba517529fec59052b1eed1e.tar.gz rust-a49927350f658c0f4ba517529fec59052b1eed1e.zip | |
Rollup merge of #86887 - jyn514:cleanup-clean, r=CraftSpider
rustdoc: remove dead code in `clean` Builds on https://github.com/rust-lang/rust/pull/86886 and should not be merged before.
| -rw-r--r-- | src/librustdoc/clean/blanket_impl.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 45 |
2 files changed, 1 insertions, 46 deletions
diff --git a/src/librustdoc/clean/blanket_impl.rs b/src/librustdoc/clean/blanket_impl.rs index c257d362694..8f74a48547d 100644 --- a/src/librustdoc/clean/blanket_impl.rs +++ b/src/librustdoc/clean/blanket_impl.rs @@ -98,7 +98,7 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> { visibility: Inherited, def_id: ItemId::Blanket { impl_id: impl_def_id, for_: item_def_id }, 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), diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 0ff708d01f5..80aaae15801 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -227,20 +227,6 @@ impl<'tcx> Clean<GenericBound> for ty::PolyTraitRef<'tcx> { } } -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 @@ impl Clean<Constant> for hir::ConstArg { } } -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 @@ impl Clean<Variant> for hir::VariantData<'_> { } } -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 { @@ -2193,22 +2167,3 @@ impl Clean<TypeBindingKind> for hir::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), - }, - } - } -} |
