Skip to content

Commit 88961b0

Browse files
committed
simplify ICE handling in HirIdValidator
1 parent 21fbb59 commit 88961b0

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

src/librustc/hir/map/hir_id_validator.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use crate::hir::def_id::{DefId, DefIndex, CRATE_DEF_INDEX};
22
use crate::hir::{self, intravisit, HirId, ItemLocalId};
3-
use syntax::ast::NodeId;
43
use crate::hir::itemlikevisit::ItemLikeVisitor;
54
use rustc_data_structures::fx::FxHashSet;
65
use rustc_data_structures::sync::{Lock, ParallelIterator, par_iter};
@@ -112,17 +111,6 @@ impl<'a, 'hir: 'a> HirIdValidator<'a, 'hir> {
112111

113112
trace!("missing hir id {:#?}", hir_id);
114113

115-
// We are already in ICE mode here, so doing a linear search
116-
// should be fine.
117-
let (node_id, _) = self.hir_map
118-
.definitions()
119-
.node_to_hir_id
120-
.iter()
121-
.enumerate()
122-
.find(|&(_, &entry)| hir_id == entry)
123-
.expect("no node_to_hir_id entry");
124-
let node_id = NodeId::from_usize(node_id);
125-
let hir_id = self.hir_map.node_to_hir_id(node_id);
126114
missing_items.push(format!("[local_id: {}, node:{}]",
127115
local_id,
128116
self.hir_map.node_to_string(hir_id)));

0 commit comments

Comments
 (0)