diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-03-14 21:05:06 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-03-14 22:34:24 +0300 |
| commit | 89b536dbc85e23275f08feaf73a7abce691bf72c (patch) | |
| tree | c24706525e37ffd0a3d0994a5ac5784b7ff10b12 /compiler/rustc_middle/src/ty | |
| parent | 30f74ff0dc4d66debc8b50724c446f817e5f75f4 (diff) | |
| download | rust-89b536dbc85e23275f08feaf73a7abce691bf72c.tar.gz rust-89b536dbc85e23275f08feaf73a7abce691bf72c.zip | |
hir: Remove `opt_local_def_id_to_hir_id` and `opt_hir_node_by_def_id`
Also replace a few `hir_node()` calls with `hir_node_by_def_id()`
Diffstat (limited to 'compiler/rustc_middle/src/ty')
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 5362b6d8b24..17ba97c5fd3 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -1265,11 +1265,9 @@ impl<'tcx> TyCtxt<'tcx> { break (scope, ty::BrNamed(def_id.into(), self.item_name(def_id.into()))); }; - let is_impl_item = match self.opt_hir_node_by_def_id(suitable_region_binding_scope) { - Some(Node::Item(..) | Node::TraitItem(..)) => false, - Some(Node::ImplItem(..)) => { - self.is_bound_region_in_impl_item(suitable_region_binding_scope) - } + let is_impl_item = match self.hir_node_by_def_id(suitable_region_binding_scope) { + Node::Item(..) | Node::TraitItem(..) => false, + Node::ImplItem(..) => self.is_bound_region_in_impl_item(suitable_region_binding_scope), _ => false, }; @@ -2355,10 +2353,6 @@ impl<'tcx> TyCtxt<'tcx> { self.intrinsic_raw(def_id) } - pub fn opt_local_def_id_to_hir_id(self, local_def_id: LocalDefId) -> Option<HirId> { - Some(self.local_def_id_to_hir_id(local_def_id)) - } - pub fn next_trait_solver_globally(self) -> bool { self.sess.opts.unstable_opts.next_solver.map_or(false, |c| c.globally) } |
