Skip to content

Commit a98f35f

Browse files
committed
Remove NodeId to HirId conversion APIs
1 parent 936b6bf commit a98f35f

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

src/librustc_hir/definitions.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ impl Definitions {
328328
#[inline]
329329
pub fn local_def_id(&self, node: ast::NodeId) -> LocalDefId {
330330
self.opt_local_def_id(node).unwrap_or_else(|| {
331-
panic!("no entry for node id: `{:?}` / `{:?}`", node, self.opt_node_id_to_hir_id(node))
331+
panic!("no entry for node id: `{:?}` / `{:?}`", node, self.node_id_to_hir_id.get(node))
332332
})
333333
}
334334

@@ -342,16 +342,6 @@ impl Definitions {
342342
self.hir_id_to_node_id[&hir_id]
343343
}
344344

345-
#[inline]
346-
pub fn node_id_to_hir_id(&self, node_id: ast::NodeId) -> hir::HirId {
347-
self.node_id_to_hir_id[node_id].unwrap()
348-
}
349-
350-
#[inline]
351-
pub fn opt_node_id_to_hir_id(&self, node_id: ast::NodeId) -> Option<hir::HirId> {
352-
self.node_id_to_hir_id[node_id]
353-
}
354-
355345
#[inline]
356346
pub fn local_def_id_to_hir_id(&self, id: LocalDefId) -> hir::HirId {
357347
let node_id = self.def_id_to_node_id[id];

src/librustc_middle/hir/map/collector.rs

-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
243243
// owner of that node.
244244
if cfg!(debug_assertions) {
245245
let node_id = self.definitions.hir_id_to_node_id(hir_id);
246-
assert_eq!(self.definitions.node_id_to_hir_id(node_id), hir_id);
247246

248247
if hir_id.owner != self.current_dep_node_owner {
249248
let node_str = match self.definitions.opt_local_def_id(node_id) {

0 commit comments

Comments
 (0)