Skip to content

Commit cf043f6

Browse files
committed
Auto merge of rust-lang#101709 - nnethercote:simplify-visitors-more, r=cjgillot
Simplify visitors more A successor to rust-lang#100392. r? `@cjgillot`
2 parents 985afe0 + 0d1469a commit cf043f6

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

clippy_lints/src/derive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ struct UnsafeVisitor<'a, 'tcx> {
425425
impl<'tcx> Visitor<'tcx> for UnsafeVisitor<'_, 'tcx> {
426426
type NestedFilter = nested_filter::All;
427427

428-
fn visit_fn(&mut self, kind: FnKind<'tcx>, decl: &'tcx FnDecl<'_>, body_id: BodyId, span: Span, id: HirId) {
428+
fn visit_fn(&mut self, kind: FnKind<'tcx>, decl: &'tcx FnDecl<'_>, body_id: BodyId, _: Span, id: HirId) {
429429
if self.has_unsafe {
430430
return;
431431
}
@@ -438,7 +438,7 @@ impl<'tcx> Visitor<'tcx> for UnsafeVisitor<'_, 'tcx> {
438438
}
439439
}
440440

441-
walk_fn(self, kind, decl, body_id, span, id);
441+
walk_fn(self, kind, decl, body_id, id);
442442
}
443443

444444
fn visit_expr(&mut self, expr: &'tcx Expr<'_>) {

clippy_lints/src/disallowed_types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint_and_then;
22

33
use rustc_data_structures::fx::FxHashMap;
44
use rustc_hir::{
5-
def::Res, def_id::DefId, Item, ItemKind, PolyTraitRef, PrimTy, TraitBoundModifier, Ty, TyKind, UseKind,
5+
def::Res, def_id::DefId, Item, ItemKind, PolyTraitRef, PrimTy, Ty, TyKind, UseKind,
66
};
77
use rustc_lint::{LateContext, LateLintPass};
88
use rustc_session::{declare_tool_lint, impl_lint_pass};
@@ -120,7 +120,7 @@ impl<'tcx> LateLintPass<'tcx> for DisallowedTypes {
120120
}
121121
}
122122

123-
fn check_poly_trait_ref(&mut self, cx: &LateContext<'tcx>, poly: &'tcx PolyTraitRef<'tcx>, _: TraitBoundModifier) {
123+
fn check_poly_trait_ref(&mut self, cx: &LateContext<'tcx>, poly: &'tcx PolyTraitRef<'tcx>) {
124124
self.check_res_emit(cx, &poly.trait_ref.path.res, poly.trait_ref.path.span);
125125
}
126126
}

clippy_lints/src/lifetimes.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_hir::FnRetTy::Return;
1010
use rustc_hir::{
1111
BareFnTy, BodyId, FnDecl, GenericArg, GenericBound, GenericParam, GenericParamKind, Generics, Impl, ImplItem,
1212
ImplItemKind, Item, ItemKind, LangItem, Lifetime, LifetimeName, ParamName, PolyTraitRef, PredicateOrigin,
13-
TraitBoundModifier, TraitFn, TraitItem, TraitItemKind, Ty, TyKind, WherePredicate,
13+
TraitFn, TraitItem, TraitItemKind, Ty, TyKind, WherePredicate,
1414
};
1515
use rustc_lint::{LateContext, LateLintPass};
1616
use rustc_middle::hir::nested_filter as middle_nested_filter;
@@ -422,7 +422,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
422422
self.record(&Some(*lifetime));
423423
}
424424

425-
fn visit_poly_trait_ref(&mut self, poly_tref: &'tcx PolyTraitRef<'tcx>, tbm: TraitBoundModifier) {
425+
fn visit_poly_trait_ref(&mut self, poly_tref: &'tcx PolyTraitRef<'tcx>) {
426426
let trait_ref = &poly_tref.trait_ref;
427427
if CLOSURE_TRAIT_BOUNDS.iter().any(|&item| {
428428
self.cx
@@ -435,7 +435,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
435435
sub_visitor.visit_trait_ref(trait_ref);
436436
self.nested_elision_site_lts.append(&mut sub_visitor.all_lts());
437437
} else {
438-
walk_poly_trait_ref(self, poly_tref, tbm);
438+
walk_poly_trait_ref(self, poly_tref);
439439
}
440440
}
441441

@@ -466,7 +466,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
466466
self.unelided_trait_object_lifetime = true;
467467
}
468468
for bound in bounds {
469-
self.visit_poly_trait_ref(bound, TraitBoundModifier::None);
469+
self.visit_poly_trait_ref(bound);
470470
}
471471
},
472472
_ => walk_ty(self, ty),

clippy_lints/src/unused_async.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedAsync {
7070
) {
7171
if !span.from_expansion() && fn_kind.asyncness() == IsAsync::Async {
7272
let mut visitor = AsyncFnVisitor { cx, found_await: false };
73-
walk_fn(&mut visitor, fn_kind, fn_decl, body.id(), span, hir_id);
73+
walk_fn(&mut visitor, fn_kind, fn_decl, body.id(), hir_id);
7474
if !visitor.found_await {
7575
span_lint_and_help(
7676
cx,

clippy_lints/src/unwrap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,6 @@ impl<'tcx> LateLintPass<'tcx> for Unwrap {
326326
unwrappables: Vec::new(),
327327
};
328328

329-
walk_fn(&mut v, kind, decl, body.id(), span, fn_id);
329+
walk_fn(&mut v, kind, decl, body.id(), fn_id);
330330
}
331331
}

clippy_utils/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ pub struct ContainsName {
11211121
}
11221122

11231123
impl<'tcx> Visitor<'tcx> for ContainsName {
1124-
fn visit_name(&mut self, _: Span, name: Symbol) {
1124+
fn visit_name(&mut self, name: Symbol) {
11251125
if self.name == name {
11261126
self.result = true;
11271127
}

0 commit comments

Comments
 (0)