about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-04-02 10:08:37 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2025-04-14 09:16:32 +1000
commit1a3dee40628c01733af12bae02c32d856db6cb0d (patch)
tree769212637b31731140144a7c5341ca14bc8c9217
parent7c5f2265e8267f9f116086d31d7ec83c0198c37b (diff)
downloadrust-1a3dee40628c01733af12bae02c32d856db6cb0d.tar.gz
rust-1a3dee40628c01733af12bae02c32d856db6cb0d.zip
Remove `rustc_middle::hir::Map`.
It's unused.
-rw-r--r--compiler/rustc_middle/src/hir/map.rs10
-rw-r--r--compiler/rustc_middle/src/hir/mod.rs5
2 files changed, 0 insertions, 15 deletions
diff --git a/compiler/rustc_middle/src/hir/map.rs b/compiler/rustc_middle/src/hir/map.rs
index daf95420c43..e0dd76bce82 100644
--- a/compiler/rustc_middle/src/hir/map.rs
+++ b/compiler/rustc_middle/src/hir/map.rs
@@ -18,16 +18,6 @@ use crate::middle::debugger_visualizer::DebuggerVisualizerFile;
 use crate::query::LocalCrate;
 use crate::ty::TyCtxt;
 
-// FIXME: the structure was necessary in the past but now it
-// only serves as "namespace" for HIR-related methods, and can be
-// removed if all the methods are reasonably renamed and moved to tcx
-// (https://github.com/rust-lang/rust/pull/118256#issuecomment-1826442834).
-#[allow(unused)] // FIXME: temporary
-#[derive(Copy, Clone)]
-pub struct Map<'hir> {
-    pub(super) tcx: TyCtxt<'hir>,
-}
-
 /// An iterator that walks up the ancestor tree of a given `HirId`.
 /// Constructed using `tcx.hir_parent_iter(hir_id)`.
 struct ParentHirIterator<'tcx> {
diff --git a/compiler/rustc_middle/src/hir/mod.rs b/compiler/rustc_middle/src/hir/mod.rs
index 640ac70d3a7..a28dcb0cb8e 100644
--- a/compiler/rustc_middle/src/hir/mod.rs
+++ b/compiler/rustc_middle/src/hir/mod.rs
@@ -116,11 +116,6 @@ impl ModuleItems {
 }
 
 impl<'tcx> TyCtxt<'tcx> {
-    #[inline(always)]
-    pub fn hir(self) -> map::Map<'tcx> {
-        map::Map { tcx: self }
-    }
-
     pub fn parent_module(self, id: HirId) -> LocalModDefId {
         if !id.is_owner() && self.def_kind(id.owner) == DefKind::Mod {
             LocalModDefId::new_unchecked(id.owner.def_id)