rustc: hir().local_def_id_to_hir_id()
-> tcx.local_def_id_to_hir_id()
cleanup
This commit is contained in:
parent
9529a5d265
commit
c697927f44
110 changed files with 189 additions and 199 deletions
|
@ -363,7 +363,7 @@ impl AddToDiagnostic for AddLifetimeParamsSuggestion<'_> {
|
|||
return false;
|
||||
};
|
||||
|
||||
let hir_id = self.tcx.hir().local_def_id_to_hir_id(anon_reg.def_id);
|
||||
let hir_id = self.tcx.local_def_id_to_hir_id(anon_reg.def_id);
|
||||
|
||||
let node = self.tcx.hir().get(hir_id);
|
||||
let is_impl = matches!(&node, hir::Node::ImplItem(_));
|
||||
|
|
|
@ -26,7 +26,7 @@ pub fn find_anon_type<'tcx>(
|
|||
br: &ty::BoundRegionKind,
|
||||
) -> Option<(&'tcx hir::Ty<'tcx>, &'tcx hir::FnSig<'tcx>)> {
|
||||
let anon_reg = tcx.is_suitable_region(region)?;
|
||||
let hir_id = tcx.hir().local_def_id_to_hir_id(anon_reg.def_id);
|
||||
let hir_id = tcx.local_def_id_to_hir_id(anon_reg.def_id);
|
||||
let fn_sig = tcx.hir().get(hir_id).fn_sig()?;
|
||||
|
||||
fn_sig
|
||||
|
|
|
@ -101,7 +101,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
|
|||
ty::AssocKind::Fn => {
|
||||
let hir = self.tcx().hir();
|
||||
if let Some(hir_id) =
|
||||
assoc_item.def_id.as_local().map(|id| hir.local_def_id_to_hir_id(id))
|
||||
assoc_item.def_id.as_local().map(|id| self.tcx().local_def_id_to_hir_id(id))
|
||||
{
|
||||
if let Some(decl) = hir.fn_decl_by_hir_id(hir_id) {
|
||||
visitor.visit_fn_decl(decl);
|
||||
|
|
|
@ -50,7 +50,7 @@ pub fn find_param_with_region<'tcx>(
|
|||
|
||||
let hir = &tcx.hir();
|
||||
let def_id = id.as_local()?;
|
||||
let hir_id = hir.local_def_id_to_hir_id(def_id);
|
||||
let hir_id = tcx.local_def_id_to_hir_id(def_id);
|
||||
|
||||
// FIXME: use def_kind
|
||||
// Don't perform this on closures
|
||||
|
|
|
@ -105,7 +105,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
|||
);
|
||||
}
|
||||
p_def_id.as_local().and_then(|id| {
|
||||
let local_id = tcx.hir().local_def_id_to_hir_id(id);
|
||||
let local_id = tcx.local_def_id_to_hir_id(id);
|
||||
let generics = tcx.hir().find_parent(local_id)?.generics()?;
|
||||
Some((id, generics))
|
||||
})
|
||||
|
|
|
@ -374,7 +374,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||
/// in its defining scope.
|
||||
#[instrument(skip(self), level = "trace", ret)]
|
||||
pub fn opaque_type_origin(&self, def_id: LocalDefId) -> Option<OpaqueTyOrigin> {
|
||||
let opaque_hir_id = self.tcx.hir().local_def_id_to_hir_id(def_id);
|
||||
let opaque_hir_id = self.tcx.local_def_id_to_hir_id(def_id);
|
||||
let parent_def_id = match self.defining_use_anchor {
|
||||
DefiningAnchor::Bubble | DefiningAnchor::Error => return None,
|
||||
DefiningAnchor::Bind(bind) => bind,
|
||||
|
@ -671,7 +671,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||
/// and `opaque_hir_id` is the `HirId` of the definition of the opaque type `Baz`.
|
||||
/// For the above example, this function returns `true` for `f1` and `false` for `f2`.
|
||||
fn may_define_opaque_type(tcx: TyCtxt<'_>, def_id: LocalDefId, opaque_hir_id: hir::HirId) -> bool {
|
||||
let mut hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
|
||||
let mut hir_id = tcx.local_def_id_to_hir_id(def_id);
|
||||
|
||||
// Named opaque types can be defined by any siblings or children of siblings.
|
||||
let scope = tcx.hir().get_defining_scope(opaque_hir_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue