1
Fork 0

Rollup merge of #137350 - nnethercote:remove-Map-3, r=Zalathar

Move methods from Map to TyCtxt, part 3.

A follow-up to #137162.

r? `@Zalathar`
This commit is contained in:
Matthias Krüger 2025-02-21 19:01:15 +01:00 committed by GitHub
commit a24eb0bae9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
105 changed files with 259 additions and 289 deletions

View file

@ -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_) => {

View file

@ -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