Skip to content

Commit c9e9725

Browse files
committed
Remove unused hir_id arg from visit_attribute.
1 parent 969a2cc commit c9e9725

File tree

6 files changed

+9
-11
lines changed

6 files changed

+9
-11
lines changed

compiler/rustc_hir/src/intravisit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ pub trait Visitor<'v>: Sized {
466466
fn visit_assoc_type_binding(&mut self, type_binding: &'v TypeBinding<'v>) {
467467
walk_assoc_type_binding(self, type_binding)
468468
}
469-
fn visit_attribute(&mut self, _id: HirId, _attr: &'v Attribute) {}
469+
fn visit_attribute(&mut self, _attr: &'v Attribute) {}
470470
fn visit_associated_item_kind(&mut self, kind: &'v AssocItemKind) {
471471
walk_associated_item_kind(self, kind);
472472
}

compiler/rustc_incremental/src/persist/dirty_clean.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
2222
use rustc_ast::{self as ast, Attribute, NestedMetaItem};
2323
use rustc_data_structures::fx::FxHashSet;
24-
use rustc_hir as hir;
2524
use rustc_hir::def_id::LocalDefId;
2625
use rustc_hir::intravisit;
2726
use rustc_hir::Node as HirNode;
@@ -473,7 +472,7 @@ impl<'tcx> intravisit::Visitor<'tcx> for FindAllAttrs<'tcx> {
473472
self.tcx.hir()
474473
}
475474

476-
fn visit_attribute(&mut self, _: hir::HirId, attr: &'tcx Attribute) {
475+
fn visit_attribute(&mut self, attr: &'tcx Attribute) {
477476
if self.is_active_attr(attr) {
478477
self.found_attrs.push(attr);
479478
}

compiler/rustc_lint/src/late.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas
337337
hir_visit::walk_path(self, p);
338338
}
339339

340-
fn visit_attribute(&mut self, _hir_id: hir::HirId, attr: &'tcx ast::Attribute) {
340+
fn visit_attribute(&mut self, attr: &'tcx ast::Attribute) {
341341
lint_callback!(self, check_attribute, attr);
342342
}
343343
}
@@ -400,7 +400,7 @@ fn late_lint_mod_pass<'tcx, T: LateLintPass<'tcx>>(
400400
// Visit the crate attributes
401401
if hir_id == hir::CRATE_HIR_ID {
402402
for attr in tcx.hir().attrs(hir::CRATE_HIR_ID).iter() {
403-
cx.visit_attribute(hir_id, attr)
403+
cx.visit_attribute(attr)
404404
}
405405
}
406406
}

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

+3-4
Original file line numberDiff line numberDiff line change
@@ -577,12 +577,11 @@ impl<'hir> Map<'hir> {
577577
/// Walks the attributes in a crate.
578578
pub fn walk_attributes(self, visitor: &mut impl Visitor<'hir>) {
579579
let krate = self.krate();
580-
for (owner, info) in krate.owners.iter_enumerated() {
580+
for info in krate.owners.iter() {
581581
if let MaybeOwner::Owner(info) = info {
582-
for (local_id, attrs) in info.attrs.map.iter() {
583-
let id = HirId { owner, local_id: *local_id };
582+
for attrs in info.attrs.map.values() {
584583
for a in *attrs {
585-
visitor.visit_attribute(id, a)
584+
visitor.visit_attribute(a)
586585
}
587586
}
588587
}

compiler/rustc_passes/src/hir_stats.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> {
238238
hir_visit::walk_assoc_type_binding(self, type_binding)
239239
}
240240

241-
fn visit_attribute(&mut self, _: hir::HirId, attr: &'v ast::Attribute) {
241+
fn visit_attribute(&mut self, attr: &'v ast::Attribute) {
242242
self.record("Attribute", Id::Attr(attr.id), attr);
243243
}
244244
}

compiler/rustc_passes/src/lib_features.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl<'tcx> Visitor<'tcx> for LibFeatureCollector<'tcx> {
120120
self.tcx.hir()
121121
}
122122

123-
fn visit_attribute(&mut self, _: rustc_hir::HirId, attr: &'tcx Attribute) {
123+
fn visit_attribute(&mut self, attr: &'tcx Attribute) {
124124
if let Some((feature, stable, span)) = self.extract(attr) {
125125
self.collect_feature(feature, stable, span);
126126
}

0 commit comments

Comments
 (0)