Skip to content

Commit 65474b2

Browse files
authored
Rollup merge of rust-lang#83108 - jyn514:remove-unused, r=estebank
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.
2 parents 3ec47de + e161a2f commit 65474b2

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

compiler/rustc_hir/src/definitions.rs

-5
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,6 @@ impl Definitions {
342342
self.def_id_to_hir_id[id].unwrap()
343343
}
344344

345-
#[inline]
346-
pub fn opt_local_def_id_to_hir_id(&self, id: LocalDefId) -> Option<hir::HirId> {
347-
self.def_id_to_hir_id[id]
348-
}
349-
350345
#[inline]
351346
pub fn opt_hir_id_to_local_def_id(&self, hir_id: hir::HirId) -> Option<LocalDefId> {
352347
self.hir_id_to_def_id.get(&hir_id).copied()

compiler/rustc_middle/src/hir/map/mod.rs

-5
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,6 @@ impl<'hir> Map<'hir> {
180180
self.tcx.definitions.local_def_id_to_hir_id(def_id)
181181
}
182182

183-
#[inline]
184-
pub fn opt_local_def_id_to_hir_id(&self, def_id: LocalDefId) -> Option<HirId> {
185-
self.tcx.definitions.opt_local_def_id_to_hir_id(def_id)
186-
}
187-
188183
pub fn iter_local_def_id(&self) -> impl Iterator<Item = LocalDefId> + '_ {
189184
self.tcx.definitions.iter_local_def_id()
190185
}

0 commit comments

Comments
 (0)