Rollup merge of #100392 - nnethercote:simplify-visitors, r=cjgillot
Simplify visitors By removing some unused arguments. r? `@cjgillot`
This commit is contained in:
commit
8237efc52d
20 changed files with 60 additions and 180 deletions
|
@ -2066,14 +2066,9 @@ impl<'tcx> Visitor<'tcx> for CheckAttrVisitor<'tcx> {
|
|||
intravisit::walk_expr(self, expr)
|
||||
}
|
||||
|
||||
fn visit_variant(
|
||||
&mut self,
|
||||
variant: &'tcx hir::Variant<'tcx>,
|
||||
generics: &'tcx hir::Generics<'tcx>,
|
||||
item_id: HirId,
|
||||
) {
|
||||
fn visit_variant(&mut self, variant: &'tcx hir::Variant<'tcx>) {
|
||||
self.check_attributes(variant.id, variant.span, Target::Variant, None);
|
||||
intravisit::walk_variant(self, variant, generics, item_id)
|
||||
intravisit::walk_variant(self, variant)
|
||||
}
|
||||
|
||||
fn visit_param(&mut self, param: &'tcx hir::Param<'tcx>) {
|
||||
|
|
|
@ -368,14 +368,7 @@ impl<'tcx> Visitor<'tcx> for MarkSymbolVisitor<'tcx> {
|
|||
self.maybe_typeck_results = old_maybe_typeck_results;
|
||||
}
|
||||
|
||||
fn visit_variant_data(
|
||||
&mut self,
|
||||
def: &'tcx hir::VariantData<'tcx>,
|
||||
_: Symbol,
|
||||
_: &hir::Generics<'_>,
|
||||
_: hir::HirId,
|
||||
_: rustc_span::Span,
|
||||
) {
|
||||
fn visit_variant_data(&mut self, def: &'tcx hir::VariantData<'tcx>) {
|
||||
let tcx = self.tcx;
|
||||
let has_repr_c = self.repr_has_repr_c;
|
||||
let has_repr_simd = self.repr_has_repr_simd;
|
||||
|
|
|
@ -276,14 +276,9 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> {
|
|||
hir_visit::walk_field_def(self, s)
|
||||
}
|
||||
|
||||
fn visit_variant(
|
||||
&mut self,
|
||||
v: &'v hir::Variant<'v>,
|
||||
g: &'v hir::Generics<'v>,
|
||||
item_id: hir::HirId,
|
||||
) {
|
||||
fn visit_variant(&mut self, v: &'v hir::Variant<'v>) {
|
||||
self.record("Variant", Id::None, v);
|
||||
hir_visit::walk_variant(self, v, g, item_id)
|
||||
hir_visit::walk_variant(self, v)
|
||||
}
|
||||
|
||||
fn visit_lifetime(&mut self, lifetime: &'v hir::Lifetime) {
|
||||
|
|
|
@ -11,7 +11,7 @@ use rustc_hir::def::{DefKind, Res};
|
|||
use rustc_hir::def_id::{LocalDefId, CRATE_DEF_ID};
|
||||
use rustc_hir::hir_id::CRATE_HIR_ID;
|
||||
use rustc_hir::intravisit::{self, Visitor};
|
||||
use rustc_hir::{FieldDef, Generics, HirId, Item, ItemKind, TraitRef, Ty, TyKind, Variant};
|
||||
use rustc_hir::{FieldDef, Item, ItemKind, TraitRef, Ty, TyKind, Variant};
|
||||
use rustc_middle::hir::nested_filter;
|
||||
use rustc_middle::middle::privacy::AccessLevels;
|
||||
use rustc_middle::middle::stability::{AllowUnstable, DeprecationEntry, Index};
|
||||
|
@ -442,7 +442,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
|
|||
);
|
||||
}
|
||||
|
||||
fn visit_variant(&mut self, var: &'tcx Variant<'tcx>, g: &'tcx Generics<'tcx>, item_id: HirId) {
|
||||
fn visit_variant(&mut self, var: &'tcx Variant<'tcx>) {
|
||||
self.annotate(
|
||||
self.tcx.hir().local_def_id(var.id),
|
||||
var.span,
|
||||
|
@ -465,7 +465,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
|
|||
);
|
||||
}
|
||||
|
||||
intravisit::walk_variant(v, var, g, item_id)
|
||||
intravisit::walk_variant(v, var)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
@ -598,9 +598,9 @@ impl<'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'tcx> {
|
|||
intravisit::walk_impl_item(self, ii);
|
||||
}
|
||||
|
||||
fn visit_variant(&mut self, var: &'tcx Variant<'tcx>, g: &'tcx Generics<'tcx>, item_id: HirId) {
|
||||
fn visit_variant(&mut self, var: &'tcx Variant<'tcx>) {
|
||||
self.check_missing_stability(self.tcx.hir().local_def_id(var.id), var.span);
|
||||
intravisit::walk_variant(self, var, g, item_id);
|
||||
intravisit::walk_variant(self, var);
|
||||
}
|
||||
|
||||
fn visit_field_def(&mut self, s: &'tcx FieldDef<'tcx>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue