diff options
| author | ljedrz <ljedrz@gmail.com> | 2019-06-16 17:37:58 +0200 |
|---|---|---|
| committer | ljedrz <ljedrz@gmail.com> | 2019-06-17 18:59:27 +0200 |
| commit | 88961b049ec2e8dec3f7b1c8166fb201c0632bbe (patch) | |
| tree | ad71fae11804886129bb268ae002e73b3cefaf88 | |
| parent | 21fbb59500ec50bab7e8a2b00af8a00c967f6b76 (diff) | |
| download | rust-88961b049ec2e8dec3f7b1c8166fb201c0632bbe.tar.gz rust-88961b049ec2e8dec3f7b1c8166fb201c0632bbe.zip | |
simplify ICE handling in HirIdValidator
| -rw-r--r-- | src/librustc/hir/map/hir_id_validator.rs | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/src/librustc/hir/map/hir_id_validator.rs b/src/librustc/hir/map/hir_id_validator.rs index d6ac7ea2ed7..32d0e069f72 100644 --- a/src/librustc/hir/map/hir_id_validator.rs +++ b/src/librustc/hir/map/hir_id_validator.rs @@ -1,6 +1,5 @@ use crate::hir::def_id::{DefId, DefIndex, CRATE_DEF_INDEX}; use crate::hir::{self, intravisit, HirId, ItemLocalId}; -use syntax::ast::NodeId; use crate::hir::itemlikevisit::ItemLikeVisitor; use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::sync::{Lock, ParallelIterator, par_iter}; @@ -112,17 +111,6 @@ impl<'a, 'hir: 'a> HirIdValidator<'a, 'hir> { trace!("missing hir id {:#?}", hir_id); - // We are already in ICE mode here, so doing a linear search - // should be fine. - let (node_id, _) = self.hir_map - .definitions() - .node_to_hir_id - .iter() - .enumerate() - .find(|&(_, &entry)| hir_id == entry) - .expect("no node_to_hir_id entry"); - let node_id = NodeId::from_usize(node_id); - let hir_id = self.hir_map.node_to_hir_id(node_id); missing_items.push(format!("[local_id: {}, node:{}]", local_id, self.hir_map.node_to_string(hir_id))); |
