Remove rustc_middle::hir::Map
.
It's unused.
This commit is contained in:
parent
7c5f2265e8
commit
1a3dee4062
2 changed files with 0 additions and 15 deletions
|
@ -18,16 +18,6 @@ use crate::middle::debugger_visualizer::DebuggerVisualizerFile;
|
||||||
use crate::query::LocalCrate;
|
use crate::query::LocalCrate;
|
||||||
use crate::ty::TyCtxt;
|
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`.
|
/// An iterator that walks up the ancestor tree of a given `HirId`.
|
||||||
/// Constructed using `tcx.hir_parent_iter(hir_id)`.
|
/// Constructed using `tcx.hir_parent_iter(hir_id)`.
|
||||||
struct ParentHirIterator<'tcx> {
|
struct ParentHirIterator<'tcx> {
|
||||||
|
|
|
@ -116,11 +116,6 @@ impl ModuleItems {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> TyCtxt<'tcx> {
|
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 {
|
pub fn parent_module(self, id: HirId) -> LocalModDefId {
|
||||||
if !id.is_owner() && self.def_kind(id.owner) == DefKind::Mod {
|
if !id.is_owner() && self.def_kind(id.owner) == DefKind::Mod {
|
||||||
LocalModDefId::new_unchecked(id.owner.def_id)
|
LocalModDefId::new_unchecked(id.owner.def_id)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue