Skip to content

Commit 008693d

Browse files
remove Clean trait implementation for hir::TraitRef
1 parent a442c1e commit 008693d

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/librustdoc/clean/mod.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -995,18 +995,16 @@ fn clean_fn_decl_from_did_and_sig<'tcx>(
995995
}
996996
}
997997

998-
impl<'tcx> Clean<'tcx, Path> for hir::TraitRef<'tcx> {
999-
fn clean(&self, cx: &mut DocContext<'tcx>) -> Path {
1000-
let path = clean_path(self.path, cx);
1001-
register_res(cx, path.res);
1002-
path
1003-
}
998+
fn clean_trait_ref<'tcx>(trait_ref: &hir::TraitRef<'tcx>, cx: &mut DocContext<'tcx>) -> Path {
999+
let path = clean_path(trait_ref.path, cx);
1000+
register_res(cx, path.res);
1001+
path
10041002
}
10051003

10061004
impl<'tcx> Clean<'tcx, PolyTrait> for hir::PolyTraitRef<'tcx> {
10071005
fn clean(&self, cx: &mut DocContext<'tcx>) -> PolyTrait {
10081006
PolyTrait {
1009-
trait_: self.trait_ref.clean(cx),
1007+
trait_: clean_trait_ref(&self.trait_ref, cx),
10101008
generic_params: self
10111009
.bound_generic_params
10121010
.iter()
@@ -1995,7 +1993,7 @@ fn clean_impl<'tcx>(
19951993
) -> Vec<Item> {
19961994
let tcx = cx.tcx;
19971995
let mut ret = Vec::new();
1998-
let trait_ = impl_.of_trait.as_ref().map(|t| t.clean(cx));
1996+
let trait_ = impl_.of_trait.as_ref().map(|t| clean_trait_ref(t, cx));
19991997
let items =
20001998
impl_.items.iter().map(|ii| tcx.hir().impl_item(ii.id).clean(cx)).collect::<Vec<_>>();
20011999
let def_id = tcx.hir().local_def_id(hir_id);

0 commit comments

Comments
 (0)