Remove Clean trait implementation for hir::Path
This commit is contained in:
parent
482153bc20
commit
279af1d7e0
1 changed files with 6 additions and 8 deletions
|
@ -1019,7 +1019,7 @@ impl<'tcx> Clean<'tcx, bool> for hir::IsAuto {
|
||||||
|
|
||||||
impl<'tcx> Clean<'tcx, Path> for hir::TraitRef<'tcx> {
|
impl<'tcx> Clean<'tcx, Path> for hir::TraitRef<'tcx> {
|
||||||
fn clean(&self, cx: &mut DocContext<'tcx>) -> Path {
|
fn clean(&self, cx: &mut DocContext<'tcx>) -> Path {
|
||||||
let path = self.path.clean(cx);
|
let path = clean_path(self.path, cx);
|
||||||
register_res(cx, path.res);
|
register_res(cx, path.res);
|
||||||
path
|
path
|
||||||
}
|
}
|
||||||
|
@ -1344,7 +1344,7 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
|
||||||
if let Some(expanded) = maybe_expand_private_type_alias(cx, path) {
|
if let Some(expanded) = maybe_expand_private_type_alias(cx, path) {
|
||||||
expanded
|
expanded
|
||||||
} else {
|
} else {
|
||||||
let path = path.clean(cx);
|
let path = clean_path(path, cx);
|
||||||
resolve_type(cx, path)
|
resolve_type(cx, path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1380,7 +1380,7 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
|
||||||
ty::Error(_) => return Type::Infer,
|
ty::Error(_) => return Type::Infer,
|
||||||
_ => bug!("clean: expected associated type, found `{:?}`", ty),
|
_ => bug!("clean: expected associated type, found `{:?}`", ty),
|
||||||
};
|
};
|
||||||
let trait_ = hir::Path { span, res, segments: &[] }.clean(cx);
|
let trait_ = clean_path(&hir::Path { span, res, segments: &[] }, cx);
|
||||||
register_res(cx, trait_.res);
|
register_res(cx, trait_.res);
|
||||||
let self_def_id = res.opt_def_id();
|
let self_def_id = res.opt_def_id();
|
||||||
let self_type = clean_ty(qself, cx);
|
let self_type = clean_ty(qself, cx);
|
||||||
|
@ -1857,10 +1857,8 @@ fn clean_variant_data<'tcx>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> Clean<'tcx, Path> for hir::Path<'tcx> {
|
fn clean_path<'tcx>(path: &hir::Path<'tcx>, cx: &mut DocContext<'tcx>) -> Path {
|
||||||
fn clean(&self, cx: &mut DocContext<'tcx>) -> Path {
|
Path { res: path.res, segments: path.segments.iter().map(|x| x.clean(cx)).collect() }
|
||||||
Path { res: self.res, segments: self.segments.iter().map(|x| x.clean(cx)).collect() }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> Clean<'tcx, GenericArgs> for hir::GenericArgs<'tcx> {
|
impl<'tcx> Clean<'tcx, GenericArgs> for hir::GenericArgs<'tcx> {
|
||||||
|
@ -2172,7 +2170,7 @@ fn clean_use_statement<'tcx>(
|
||||||
|
|
||||||
// Also check whether imports were asked to be inlined, in case we're trying to re-export a
|
// Also check whether imports were asked to be inlined, in case we're trying to re-export a
|
||||||
// crate in Rust 2018+
|
// crate in Rust 2018+
|
||||||
let path = path.clean(cx);
|
let path = clean_path(path, cx);
|
||||||
let inner = if kind == hir::UseKind::Glob {
|
let inner = if kind == hir::UseKind::Glob {
|
||||||
if !denied {
|
if !denied {
|
||||||
let mut visited = FxHashSet::default();
|
let mut visited = FxHashSet::default();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue