1
Fork 0

Remove unused hir_id parameter from resolve_type

This commit is contained in:
Noah Lev 2021-08-26 17:47:29 -07:00
parent 6a84d34784
commit c2207f5a48
2 changed files with 7 additions and 7 deletions

View file

@ -906,7 +906,7 @@ impl Clean<bool> for hir::IsAuto {
impl Clean<Type> for hir::TraitRef<'_> { impl Clean<Type> for hir::TraitRef<'_> {
fn clean(&self, cx: &mut DocContext<'_>) -> Type { fn clean(&self, cx: &mut DocContext<'_>) -> Type {
let path = self.path.clean(cx); let path = self.path.clean(cx);
resolve_type(cx, path, self.hir_ref_id) resolve_type(cx, path)
} }
} }
@ -1164,7 +1164,7 @@ impl Clean<Item> for ty::AssocItem {
fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &mut DocContext<'_>) -> Type { fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &mut DocContext<'_>) -> Type {
use rustc_hir::GenericParamCount; use rustc_hir::GenericParamCount;
let hir::Ty { hir_id, span, ref kind } = *hir_ty; let hir::Ty { hir_id: _, span, ref kind } = *hir_ty;
let qpath = match kind { let qpath = match kind {
hir::TyKind::Path(qpath) => qpath, hir::TyKind::Path(qpath) => qpath,
_ => unreachable!(), _ => unreachable!(),
@ -1271,7 +1271,7 @@ fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &mut DocContext<'_>) -> Type {
return cx.enter_alias(ty_substs, lt_substs, ct_substs, |cx| ty.clean(cx)); return cx.enter_alias(ty_substs, lt_substs, ct_substs, |cx| ty.clean(cx));
} }
let path = path.clean(cx); let path = path.clean(cx);
resolve_type(cx, path, hir_id) resolve_type(cx, path)
} }
hir::QPath::Resolved(Some(ref qself), ref p) => { hir::QPath::Resolved(Some(ref qself), ref p) => {
// Try to normalize `<X as Y>::T` to a type // Try to normalize `<X as Y>::T` to a type
@ -1292,7 +1292,7 @@ fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &mut DocContext<'_>) -> Type {
name: p.segments.last().expect("segments were empty").ident.name, name: p.segments.last().expect("segments were empty").ident.name,
self_def_id: Some(DefId::local(qself.hir_id.owner.local_def_index)), self_def_id: Some(DefId::local(qself.hir_id.owner.local_def_index)),
self_type: Box::new(qself.clean(cx)), self_type: Box::new(qself.clean(cx)),
trait_: Box::new(resolve_type(cx, trait_path, hir_id)), trait_: Box::new(resolve_type(cx, trait_path)),
} }
} }
hir::QPath::TypeRelative(ref qself, ref segment) => { hir::QPath::TypeRelative(ref qself, ref segment) => {
@ -1308,7 +1308,7 @@ fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &mut DocContext<'_>) -> Type {
name: segment.ident.name, name: segment.ident.name,
self_def_id: res.opt_def_id(), self_def_id: res.opt_def_id(),
self_type: Box::new(qself.clean(cx)), self_type: Box::new(qself.clean(cx)),
trait_: Box::new(resolve_type(cx, trait_path, hir_id)), trait_: Box::new(resolve_type(cx, trait_path)),
} }
} }
hir::QPath::LangItem(..) => bug!("clean: requiring documentation of lang item"), hir::QPath::LangItem(..) => bug!("clean: requiring documentation of lang item"),

View file

@ -407,8 +407,8 @@ crate fn print_const_expr(tcx: TyCtxt<'_>, body: hir::BodyId) -> String {
} }
/// Given a type Path, resolve it to a Type using the TyCtxt /// Given a type Path, resolve it to a Type using the TyCtxt
crate fn resolve_type(cx: &mut DocContext<'_>, path: Path, id: hir::HirId) -> Type { crate fn resolve_type(cx: &mut DocContext<'_>, path: Path) -> Type {
debug!("resolve_type({:?},{:?})", path, id); debug!("resolve_type({:?})", path);
let is_generic = match path.res { let is_generic = match path.res {
Res::PrimTy(p) => return Primitive(PrimitiveType::from(p)), Res::PrimTy(p) => return Primitive(PrimitiveType::from(p)),