From e161a2fd730624e79a7ed420dad7278d6589f6db Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Sun, 14 Mar 2021 01:37:13 -0500 Subject: [PATCH] Remove unused `opt_local_def_id_to_hir_id` function Found while investigating #82933 - all LocalDefIds are expected to have HirIds, there's no point in pretending otherwise. --- compiler/rustc_hir/src/definitions.rs | 5 ----- compiler/rustc_middle/src/hir/map/mod.rs | 5 ----- 2 files changed, 10 deletions(-) diff --git a/compiler/rustc_hir/src/definitions.rs b/compiler/rustc_hir/src/definitions.rs index ac6a359ee577d..3266dfac702ba 100644 --- a/compiler/rustc_hir/src/definitions.rs +++ b/compiler/rustc_hir/src/definitions.rs @@ -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 { - self.def_id_to_hir_id[id] - } - #[inline] pub fn opt_hir_id_to_local_def_id(&self, hir_id: hir::HirId) -> Option { self.hir_id_to_def_id.get(&hir_id).copied() diff --git a/compiler/rustc_middle/src/hir/map/mod.rs b/compiler/rustc_middle/src/hir/map/mod.rs index 41ecffb9c5604..9d00f0715a012 100644 --- a/compiler/rustc_middle/src/hir/map/mod.rs +++ b/compiler/rustc_middle/src/hir/map/mod.rs @@ -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 { - self.tcx.definitions.opt_local_def_id_to_hir_id(def_id) - } - pub fn iter_local_def_id(&self) -> impl Iterator + '_ { self.tcx.definitions.iter_local_def_id() }