Skip to content

Commit

Permalink
Rollup merge of rust-lang#83108 - jyn514:remove-unused, r=estebank
Browse files Browse the repository at this point in the history
Remove unused `opt_local_def_id_to_hir_id` function

Found while investigating rust-lang#82933 - all LocalDefIds are expected to have
HirIds, there's no point in pretending otherwise.
  • Loading branch information
Dylan-DPC authored Mar 15, 2021
2 parents 3ec47de + e161a2f commit 65474b2
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 65474b2

Please sign in to comment.