Simplify rustc_hir::intravisit::Visitor::visit_variant_data
.
It has four arguments that are never used. This avoids lots of argument passing in functions that feed into `visit_variant_data`.
This commit is contained in:
parent
f03ce30962
commit
8c5303898e
11 changed files with 32 additions and 116 deletions
|
@ -24,7 +24,6 @@ use rustc_hir::intravisit::Visitor;
|
|||
use rustc_middle::hir::nested_filter;
|
||||
use rustc_middle::ty::{self, TyCtxt};
|
||||
use rustc_session::lint::LintPass;
|
||||
use rustc_span::symbol::Symbol;
|
||||
use rustc_span::Span;
|
||||
|
||||
use std::any::Any;
|
||||
|
@ -194,14 +193,7 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas
|
|||
self.context.cached_typeck_results.set(old_cached_typeck_results);
|
||||
}
|
||||
|
||||
fn visit_variant_data(
|
||||
&mut self,
|
||||
s: &'tcx hir::VariantData<'tcx>,
|
||||
_: Symbol,
|
||||
_: &'tcx hir::Generics<'tcx>,
|
||||
_: hir::HirId,
|
||||
_: Span,
|
||||
) {
|
||||
fn visit_variant_data(&mut self, s: &'tcx hir::VariantData<'tcx>) {
|
||||
lint_callback!(self, check_struct_def, s);
|
||||
hir_visit::walk_struct_def(self, s);
|
||||
}
|
||||
|
@ -213,15 +205,10 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas
|
|||
})
|
||||
}
|
||||
|
||||
fn visit_variant(
|
||||
&mut self,
|
||||
v: &'tcx hir::Variant<'tcx>,
|
||||
g: &'tcx hir::Generics<'tcx>,
|
||||
item_id: hir::HirId,
|
||||
) {
|
||||
fn visit_variant(&mut self, v: &'tcx hir::Variant<'tcx>) {
|
||||
self.with_lint_attrs(v.id, |cx| {
|
||||
lint_callback!(cx, check_variant, v);
|
||||
hir_visit::walk_variant(cx, v, g, item_id);
|
||||
hir_visit::walk_variant(cx, v);
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -772,14 +772,9 @@ impl<'tcx> intravisit::Visitor<'tcx> for LintLevelMapBuilder<'tcx> {
|
|||
})
|
||||
}
|
||||
|
||||
fn visit_variant(
|
||||
&mut self,
|
||||
v: &'tcx hir::Variant<'tcx>,
|
||||
g: &'tcx hir::Generics<'tcx>,
|
||||
item_id: hir::HirId,
|
||||
) {
|
||||
fn visit_variant(&mut self, v: &'tcx hir::Variant<'tcx>) {
|
||||
self.with_lint_attrs(v.id, |builder| {
|
||||
intravisit::walk_variant(builder, v, g, item_id);
|
||||
intravisit::walk_variant(builder, v);
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue