about summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/foreign_modules.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-02-03 10:45:49 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2025-02-17 13:21:02 +1100
commitf86f7ad5f2d3eb6631e5fab57630a4fee9a50d01 (patch)
treee63bccd3bd1aebd7514838377a653ca2aa35868b /compiler/rustc_metadata/src/foreign_modules.rs
parentcd1d84cdf76e86f2647eb7fd157047b73e76bdf5 (diff)
downloadrust-f86f7ad5f2d3eb6631e5fab57630a4fee9a50d01.tar.gz
rust-f86f7ad5f2d3eb6631e5fab57630a4fee9a50d01.zip
Move some `Map` methods onto `TyCtxt`.
The end goal is to eliminate `Map` altogether.

I added a `hir_` prefix to all of them, that seemed simplest. The
exceptions are `module_items` which became `hir_module_free_items` because
there was already a `hir_module_items`, and `items` which became
`hir_free_items` for consistency with `hir_module_free_items`.
Diffstat (limited to 'compiler/rustc_metadata/src/foreign_modules.rs')
-rw-r--r--compiler/rustc_metadata/src/foreign_modules.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_metadata/src/foreign_modules.rs b/compiler/rustc_metadata/src/foreign_modules.rs
index 154eb684f11..24689ea61d0 100644
--- a/compiler/rustc_metadata/src/foreign_modules.rs
+++ b/compiler/rustc_metadata/src/foreign_modules.rs
@@ -10,13 +10,13 @@ pub(crate) fn collect(tcx: TyCtxt<'_>, LocalCrate: LocalCrate) -> FxIndexMap<Def
     let mut modules = FxIndexMap::default();
 
     // We need to collect all the `ForeignMod`, even if they are empty.
-    for id in tcx.hir().items() {
+    for id in tcx.hir_free_items() {
         if !matches!(tcx.def_kind(id.owner_id), DefKind::ForeignMod) {
             continue;
         }
 
         let def_id = id.owner_id.to_def_id();
-        let item = tcx.hir().item(id);
+        let item = tcx.hir_item(id);
 
         if let hir::ItemKind::ForeignMod { abi, items } = item.kind {
             let foreign_items = items.iter().map(|it| it.id.owner_id.to_def_id()).collect();