diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-07-14 19:53:57 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-09-18 14:41:50 +0200 |
| commit | d60bbde7e21f3e274263fe82f5c85b2a6c215020 (patch) | |
| tree | 700ca02e39407c5ea2ad3d8eba034ce7d98c9d51 /compiler/rustc_middle/src/hir | |
| parent | 59f43bdd299df167ea179c61b682911c486324b1 (diff) | |
| download | rust-d60bbde7e21f3e274263fe82f5c85b2a6c215020.tar.gz rust-d60bbde7e21f3e274263fe82f5c85b2a6c215020.zip | |
Do not preallocate UseTree HirIds.
Diffstat (limited to 'compiler/rustc_middle/src/hir')
| -rw-r--r-- | compiler/rustc_middle/src/hir/map/mod.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/compiler/rustc_middle/src/hir/map/mod.rs b/compiler/rustc_middle/src/hir/map/mod.rs index 10714a4b706..495c5e17197 100644 --- a/compiler/rustc_middle/src/hir/map/mod.rs +++ b/compiler/rustc_middle/src/hir/map/mod.rs @@ -7,7 +7,7 @@ use rustc_data_structures::fingerprint::Fingerprint; use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::svh::Svh; use rustc_hir::def::{DefKind, Res}; -use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, CRATE_DEF_ID, CRATE_DEF_INDEX, LOCAL_CRATE}; +use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, CRATE_DEF_ID, LOCAL_CRATE}; use rustc_hir::definitions::{DefKey, DefPath, DefPathHash}; use rustc_hir::intravisit::{self, Visitor}; use rustc_hir::itemlikevisit::ItemLikeVisitor; @@ -206,11 +206,6 @@ impl<'hir> Map<'hir> { } pub fn opt_def_kind(&self, local_def_id: LocalDefId) -> Option<DefKind> { - // FIXME(eddyb) support `find` on the crate root. - if local_def_id.to_def_id().index == CRATE_DEF_INDEX { - return Some(DefKind::Mod); - } - let hir_id = self.local_def_id_to_hir_id(local_def_id); let def_kind = match self.find(hir_id)? { Node::Item(item) => match item.kind { |
