diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-03-06 17:24:13 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-04-16 16:29:15 +1000 |
| commit | 4b27cc8b7ab0551475ce1799e8cc43c5d1327f7e (patch) | |
| tree | 826866fa8e9f9a7f6648fcf95a17202ba84f8d7a /compiler/rustc_passes/src | |
| parent | e93f75428934cce6c14b34fdb44d06affe3f4802 (diff) | |
| download | rust-4b27cc8b7ab0551475ce1799e8cc43c5d1327f7e.tar.gz rust-4b27cc8b7ab0551475ce1799e8cc43c5d1327f7e.zip | |
Avoid lots of `hir::HirId{,Map,Set}` qualifiers.
Because they're a bit redundant.
Diffstat (limited to 'compiler/rustc_passes/src')
| -rw-r--r-- | compiler/rustc_passes/src/hir_stats.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_passes/src/liveness.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_passes/src/naked_functions.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_passes/src/upvars.rs | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_passes/src/hir_stats.rs b/compiler/rustc_passes/src/hir_stats.rs index 72c6a714e4d..49408c5618b 100644 --- a/compiler/rustc_passes/src/hir_stats.rs +++ b/compiler/rustc_passes/src/hir_stats.rs @@ -389,7 +389,7 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { hir_visit::walk_fn(self, fk, fd, b, id) } - fn visit_use(&mut self, p: &'v hir::UsePath<'v>, hir_id: hir::HirId) { + fn visit_use(&mut self, p: &'v hir::UsePath<'v>, hir_id: HirId) { // This is `visit_use`, but the type is `Path` so record it that way. self.record("Path", Id::None, p); hir_visit::walk_use(self, p, hir_id) @@ -462,7 +462,7 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { hir_visit::walk_lifetime(self, lifetime) } - fn visit_path(&mut self, path: &hir::Path<'v>, _id: hir::HirId) { + fn visit_path(&mut self, path: &hir::Path<'v>, _id: HirId) { self.record("Path", Id::None, path); hir_visit::walk_path(self, path) } diff --git a/compiler/rustc_passes/src/liveness.rs b/compiler/rustc_passes/src/liveness.rs index 125084f4750..c7729302783 100644 --- a/compiler/rustc_passes/src/liveness.rs +++ b/compiler/rustc_passes/src/liveness.rs @@ -602,7 +602,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> { String::from_utf8(wr).unwrap() } - fn log_liveness(&self, entry_ln: LiveNode, hir_id: hir::HirId) { + fn log_liveness(&self, entry_ln: LiveNode, hir_id: HirId) { // hack to skip the loop unless debug! is enabled: debug!( "^^ liveness computation results for body {} (entry={:?})", diff --git a/compiler/rustc_passes/src/naked_functions.rs b/compiler/rustc_passes/src/naked_functions.rs index bd34b0597e2..a1f37ee3b83 100644 --- a/compiler/rustc_passes/src/naked_functions.rs +++ b/compiler/rustc_passes/src/naked_functions.rs @@ -5,7 +5,7 @@ use rustc_hir as hir; use rustc_hir::def::DefKind; use rustc_hir::def_id::{LocalDefId, LocalModDefId}; use rustc_hir::intravisit::Visitor; -use rustc_hir::{ExprKind, InlineAsmOperand, StmtKind}; +use rustc_hir::{ExprKind, HirIdSet, InlineAsmOperand, StmtKind}; use rustc_middle::query::Providers; use rustc_middle::ty::TyCtxt; use rustc_session::lint::builtin::UNDEFINED_NAKED_FUNCTION_ABI; @@ -94,7 +94,7 @@ fn check_no_patterns(tcx: TyCtxt<'_>, params: &[hir::Param<'_>]) { /// Checks that function parameters aren't used in the function body. fn check_no_parameters_use<'tcx>(tcx: TyCtxt<'tcx>, body: &'tcx hir::Body<'tcx>) { - let mut params = hir::HirIdSet::default(); + let mut params = HirIdSet::default(); for param in body.params { param.pat.each_binding(|_binding_mode, hir_id, _span, _ident| { params.insert(hir_id); @@ -105,7 +105,7 @@ fn check_no_parameters_use<'tcx>(tcx: TyCtxt<'tcx>, body: &'tcx hir::Body<'tcx>) struct CheckParameters<'tcx> { tcx: TyCtxt<'tcx>, - params: hir::HirIdSet, + params: HirIdSet, } impl<'tcx> Visitor<'tcx> for CheckParameters<'tcx> { diff --git a/compiler/rustc_passes/src/upvars.rs b/compiler/rustc_passes/src/upvars.rs index 4d44e8762b0..2eed58d10bb 100644 --- a/compiler/rustc_passes/src/upvars.rs +++ b/compiler/rustc_passes/src/upvars.rs @@ -66,7 +66,7 @@ impl CaptureCollector<'_, '_> { } impl<'tcx> Visitor<'tcx> for CaptureCollector<'_, 'tcx> { - fn visit_path(&mut self, path: &hir::Path<'tcx>, _: hir::HirId) { + fn visit_path(&mut self, path: &hir::Path<'tcx>, _: HirId) { if let Res::Local(var_id) = path.res { self.visit_local_use(var_id, path.span); } |
