about summary refs log tree commit diff
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
commitb141440f8621e238941f1b79a4e9ea7bcd9c38bc (patch)
tree3a64ee7d27f6a05a46c79a4fe80ffa5dffa1b58a
parent0b90953a2d35b1886829fb8ec986d59d337f9c3a (diff)
downloadrust-b141440f8621e238941f1b79a4e9ea7bcd9c38bc.tar.gz
rust-b141440f8621e238941f1b79a4e9ea7bcd9c38bc.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`.
-rw-r--r--src/driver/jit.rs2
-rw-r--r--src/global_asm.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/driver/jit.rs b/src/driver/jit.rs
index 2e713171ae0..57c88f4b0f9 100644
--- a/src/driver/jit.rs
+++ b/src/driver/jit.rs
@@ -124,7 +124,7 @@ pub(crate) fn run_jit(tcx: TyCtxt<'_>, codegen_mode: CodegenMode, jit_args: Vec<
                     crate::constant::codegen_static(tcx, &mut jit_module, def_id);
                 }
                 MonoItem::GlobalAsm(item_id) => {
-                    let item = tcx.hir().item(item_id);
+                    let item = tcx.hir_item(item_id);
                     tcx.dcx().span_fatal(item.span, "Global asm is not supported in JIT mode");
                 }
             }
diff --git a/src/global_asm.rs b/src/global_asm.rs
index c0a3ce84d52..54745b0d8c1 100644
--- a/src/global_asm.rs
+++ b/src/global_asm.rs
@@ -15,7 +15,7 @@ use rustc_target::asm::InlineAsmArch;
 use crate::prelude::*;
 
 pub(crate) fn codegen_global_asm_item(tcx: TyCtxt<'_>, global_asm: &mut String, item_id: ItemId) {
-    let item = tcx.hir().item(item_id);
+    let item = tcx.hir_item(item_id);
     if let rustc_hir::ItemKind::GlobalAsm(asm) = item.kind {
         let is_x86 =
             matches!(tcx.sess.asm_arch.unwrap(), InlineAsmArch::X86 | InlineAsmArch::X86_64);