Skip to content

Commit

Permalink
Remove unused opt_local_def_id_to_hir_id function
Browse files Browse the repository at this point in the history
Found while investigating rust-lang#82933 - all LocalDefIds are expected to have
HirIds, there's no point in pretending otherwise.
  • Loading branch information
jyn514 committed Mar 14, 2021
1 parent 5c6d3bf commit e161a2f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
5 changes: 0 additions & 5 deletions compiler/rustc_hir/src/definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,6 @@ impl Definitions {
self.def_id_to_hir_id[id].unwrap()
}

#[inline]
pub fn opt_local_def_id_to_hir_id(&self, id: LocalDefId) -> Option<hir::HirId> {
self.def_id_to_hir_id[id]
}

#[inline]
pub fn opt_hir_id_to_local_def_id(&self, hir_id: hir::HirId) -> Option<LocalDefId> {
self.hir_id_to_def_id.get(&hir_id).copied()
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_middle/src/hir/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,6 @@ impl<'hir> Map<'hir> {
self.tcx.definitions.local_def_id_to_hir_id(def_id)
}

#[inline]
pub fn opt_local_def_id_to_hir_id(&self, def_id: LocalDefId) -> Option<HirId> {
self.tcx.definitions.opt_local_def_id_to_hir_id(def_id)
}

pub fn iter_local_def_id(&self) -> impl Iterator<Item = LocalDefId> + '_ {
self.tcx.definitions.iter_local_def_id()
}
Expand Down

0 comments on commit e161a2f

Please sign in to comment.