Move methods from Map to TyCtxt, part 3.
Continuing the work from #137162. Every method gains a `hir_` prefix.
This commit is contained in:
parent
43c2b0086a
commit
806be25fc9
105 changed files with 243 additions and 273 deletions
|
@ -95,7 +95,7 @@ fn impl_item_implementor_ids(tcx: TyCtxt<'_>, impl_id: DefId) -> DefIdMap<DefId>
|
|||
|
||||
fn associated_item(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::AssocItem {
|
||||
let id = tcx.local_def_id_to_hir_id(def_id);
|
||||
let parent_def_id = tcx.hir().get_parent_item(id);
|
||||
let parent_def_id = tcx.hir_get_parent_item(id);
|
||||
let parent_item = tcx.hir().expect_item(parent_def_id.def_id);
|
||||
match parent_item.kind {
|
||||
hir::ItemKind::Impl(impl_) => {
|
||||
|
|
|
@ -98,10 +98,10 @@ impl<'tcx> OpaqueTypeCollector<'tcx> {
|
|||
let opaque_hir_id = self.tcx.local_def_id_to_hir_id(opaque_def_id);
|
||||
|
||||
// Named opaque types can be defined by any siblings or children of siblings.
|
||||
let scope = self.tcx.hir().get_defining_scope(opaque_hir_id);
|
||||
let scope = self.tcx.hir_get_defining_scope(opaque_hir_id);
|
||||
// We walk up the node tree until we hit the root or the scope of the opaque type.
|
||||
while hir_id != scope && hir_id != CRATE_HIR_ID {
|
||||
hir_id = self.tcx.hir().get_parent_item(hir_id).into();
|
||||
hir_id = self.tcx.hir_get_parent_item(hir_id).into();
|
||||
}
|
||||
// Syntactically, we are allowed to define the concrete type if:
|
||||
hir_id == scope
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue