Remove unused span argument from check_mod and process_mod.

This commit is contained in:
Nicholas Nethercote 2022-09-12 13:23:26 +10:00
parent 925363f13d
commit eff1106d56
3 changed files with 8 additions and 14 deletions

View File

@ -76,8 +76,8 @@ impl<'tcx, T: LateLintPass<'tcx>> LateContextAndPass<'tcx, T> {
self.context.param_env = old_param_env;
}
fn process_mod(&mut self, m: &'tcx hir::Mod<'tcx>, s: Span, n: hir::HirId) {
lint_callback!(self, check_mod, m, s, n);
fn process_mod(&mut self, m: &'tcx hir::Mod<'tcx>, n: hir::HirId) {
lint_callback!(self, check_mod, m, n);
hir_visit::walk_mod(self, m, n);
}
}
@ -220,9 +220,9 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas
hir_visit::walk_inf(self, inf);
}
fn visit_mod(&mut self, m: &'tcx hir::Mod<'tcx>, s: Span, n: hir::HirId) {
fn visit_mod(&mut self, m: &'tcx hir::Mod<'tcx>, _: Span, n: hir::HirId) {
if !self.context.only_module {
self.process_mod(m, s, n);
self.process_mod(m, n);
}
}
@ -358,8 +358,8 @@ fn late_lint_mod_pass<'tcx, T: LateLintPass<'tcx>>(
let mut cx = LateContextAndPass { context, pass };
let (module, span, hir_id) = tcx.hir().get_module(module_def_id);
cx.process_mod(module, span, hir_id);
let (module, _span, hir_id) = tcx.hir().get_module(module_def_id);
cx.process_mod(module, hir_id);
// Visit the crate attributes
if hir_id == hir::CRATE_HIR_ID {

View File

@ -327,13 +327,7 @@ impl NonSnakeCase {
}
impl<'tcx> LateLintPass<'tcx> for NonSnakeCase {
fn check_mod(
&mut self,
cx: &LateContext<'_>,
_: &'tcx hir::Mod<'tcx>,
_: Span,
id: hir::HirId,
) {
fn check_mod(&mut self, cx: &LateContext<'_>, _: &'tcx hir::Mod<'tcx>, id: hir::HirId) {
if id != hir::CRATE_HIR_ID {
return;
}

View File

@ -16,7 +16,7 @@ macro_rules! late_lint_methods {
fn check_body_post(a: &$hir hir::Body<$hir>);
fn check_crate();
fn check_crate_post();
fn check_mod(a: &$hir hir::Mod<$hir>, b: Span, c: hir::HirId);
fn check_mod(a: &$hir hir::Mod<$hir>, b: hir::HirId);
fn check_foreign_item(a: &$hir hir::ForeignItem<$hir>);
fn check_item(a: &$hir hir::Item<$hir>);
fn check_item_post(a: &$hir hir::Item<$hir>);