Skip to content

Commit b0e8b7d

Browse files
committed
rustdoc: Remove unused Clean impls
1 parent 6f931da commit b0e8b7d

File tree

2 files changed

+1
-46
lines changed

2 files changed

+1
-46
lines changed

src/librustdoc/clean/blanket_impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
9898
visibility: Inherited,
9999
def_id: FakeDefId::new_fake(item_def_id.krate),
100100
kind: box ImplItem(Impl {
101-
span: self.cx.tcx.def_span(impl_def_id).clean(self.cx),
101+
span: Span::from_rustc_span(self.cx.tcx.def_span(impl_def_id)),
102102
unsafety: hir::Unsafety::Normal,
103103
generics: (
104104
self.cx.tcx.generics_of(impl_def_id),

src/librustdoc/clean/mod.rs

-45
Original file line numberDiff line numberDiff line change
@@ -227,20 +227,6 @@ impl<'tcx> Clean<GenericBound> for ty::PolyTraitRef<'tcx> {
227227
}
228228
}
229229

230-
impl<'tcx> Clean<Option<Vec<GenericBound>>> for InternalSubsts<'tcx> {
231-
fn clean(&self, cx: &mut DocContext<'_>) -> Option<Vec<GenericBound>> {
232-
let mut v = Vec::new();
233-
v.extend(self.regions().filter_map(|r| r.clean(cx)).map(GenericBound::Outlives));
234-
v.extend(self.types().map(|t| {
235-
GenericBound::TraitBound(
236-
PolyTrait { trait_: t.clean(cx), generic_params: Vec::new() },
237-
hir::TraitBoundModifier::None,
238-
)
239-
}));
240-
if !v.is_empty() { Some(v) } else { None }
241-
}
242-
}
243-
244230
impl Clean<Lifetime> for hir::Lifetime {
245231
fn clean(&self, cx: &mut DocContext<'_>) -> Lifetime {
246232
let def = cx.tcx.named_region(self.hir_id);
@@ -296,12 +282,6 @@ impl Clean<Constant> for hir::ConstArg {
296282
}
297283
}
298284

299-
impl Clean<Lifetime> for ty::GenericParamDef {
300-
fn clean(&self, _cx: &mut DocContext<'_>) -> Lifetime {
301-
Lifetime(self.name)
302-
}
303-
}
304-
305285
impl Clean<Option<Lifetime>> for ty::RegionKind {
306286
fn clean(&self, _cx: &mut DocContext<'_>) -> Option<Lifetime> {
307287
match *self {
@@ -1764,12 +1744,6 @@ impl Clean<Variant> for hir::VariantData<'_> {
17641744
}
17651745
}
17661746

1767-
impl Clean<Span> for rustc_span::Span {
1768-
fn clean(&self, _cx: &mut DocContext<'_>) -> Span {
1769-
Span::from_rustc_span(*self)
1770-
}
1771-
}
1772-
17731747
impl Clean<Path> for hir::Path<'_> {
17741748
fn clean(&self, cx: &mut DocContext<'_>) -> Path {
17751749
Path {
@@ -2211,22 +2185,3 @@ impl Clean<TypeBindingKind> for hir::TypeBindingKind<'_> {
22112185
}
22122186
}
22132187
}
2214-
2215-
enum SimpleBound {
2216-
TraitBound(Vec<PathSegment>, Vec<SimpleBound>, Vec<GenericParamDef>, hir::TraitBoundModifier),
2217-
Outlives(Lifetime),
2218-
}
2219-
2220-
impl From<GenericBound> for SimpleBound {
2221-
fn from(bound: GenericBound) -> Self {
2222-
match bound.clone() {
2223-
GenericBound::Outlives(l) => SimpleBound::Outlives(l),
2224-
GenericBound::TraitBound(t, mod_) => match t.trait_ {
2225-
Type::ResolvedPath { path, .. } => {
2226-
SimpleBound::TraitBound(path.segments, Vec::new(), t.generic_params, mod_)
2227-
}
2228-
_ => panic!("Unexpected bound {:?}", bound),
2229-
},
2230-
}
2231-
}
2232-
}

0 commit comments

Comments
 (0)