Skip to content

Commit fabc26f

Browse files
committed
Stop visiting visibility.
1 parent 60bb2a7 commit fabc26f

File tree

8 files changed

+9
-10
lines changed

8 files changed

+9
-10
lines changed

clippy_lints/src/cognitive_complexity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl CognitiveComplexity {
8282

8383
if rust_cc > self.limit.limit() {
8484
let fn_span = match kind {
85-
FnKind::ItemFn(ident, _, _, _) | FnKind::Method(ident, _, _) => ident.span,
85+
FnKind::ItemFn(ident, _, _) | FnKind::Method(ident, _) => ident.span,
8686
FnKind::Closure => {
8787
let header_span = body_span.with_hi(decl.output.span().lo());
8888
let pos = snippet_opt(cx, header_span).and_then(|snip| {

clippy_lints/src/functions/not_unsafe_ptr_arg_deref.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ pub(super) fn check_fn<'tcx>(
1717
hir_id: hir::HirId,
1818
) {
1919
let unsafety = match kind {
20-
intravisit::FnKind::ItemFn(_, _, hir::FnHeader { unsafety, .. }, _) => unsafety,
21-
intravisit::FnKind::Method(_, sig, _) => sig.header.unsafety,
20+
intravisit::FnKind::ItemFn(_, _, hir::FnHeader { unsafety, .. }) => unsafety,
21+
intravisit::FnKind::Method(_, sig) => sig.header.unsafety,
2222
intravisit::FnKind::Closure => return,
2323
};
2424

clippy_lints/src/functions/too_many_arguments.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ pub(super) fn check_fn(
2626
header: hir::FnHeader { abi: Abi::Rust, .. },
2727
..
2828
},
29-
_,
3029
)
31-
| intravisit::FnKind::ItemFn(_, _, hir::FnHeader { abi: Abi::Rust, .. }, _) => check_arg_number(
30+
| intravisit::FnKind::ItemFn(_, _, hir::FnHeader { abi: Abi::Rust, .. }) => check_arg_number(
3231
cx,
3332
decl,
3433
span.with_hi(decl.output.span().hi()),

clippy_lints/src/needless_pass_by_value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue {
8585
}
8686

8787
match kind {
88-
FnKind::ItemFn(.., header, _) => {
88+
FnKind::ItemFn(.., header) => {
8989
let attrs = cx.tcx.hir().attrs(hir_id);
9090
if header.abi != Abi::Rust || requires_exact_signature(attrs) {
9191
return;

clippy_lints/src/pass_by_ref_or_value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ impl<'tcx> LateLintPass<'tcx> for PassByRefOrValue {
251251
}
252252

253253
match kind {
254-
FnKind::ItemFn(.., header, _) => {
254+
FnKind::ItemFn(.., header) => {
255255
if header.abi != Abi::Rust {
256256
return;
257257
}

clippy_lints/src/return_self_not_must_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<'tcx> LateLintPass<'tcx> for ReturnSelfNotMustUse {
111111
) {
112112
if_chain! {
113113
// We are only interested in methods, not in functions or associated functions.
114-
if matches!(kind, FnKind::Method(_, _, _));
114+
if matches!(kind, FnKind::Method(_, _));
115115
if let Some(fn_def) = cx.tcx.hir().opt_local_def_id(hir_id);
116116
if let Some(impl_def) = cx.tcx.impl_of_method(fn_def.to_def_id());
117117
// We don't want this method to be te implementation of a trait because the

clippy_lints/src/unused_async.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedAsync {
6767
span: Span,
6868
hir_id: HirId,
6969
) {
70-
if let FnKind::ItemFn(_, _, FnHeader { asyncness, .. }, _) = &fn_kind {
70+
if let FnKind::ItemFn(_, _, FnHeader { asyncness, .. }) = &fn_kind {
7171
if matches!(asyncness, IsAsync::Async) {
7272
let mut visitor = AsyncFnVisitor { cx, found_await: false };
7373
walk_fn(&mut visitor, fn_kind, fn_decl, body.id(), span, hir_id);

clippy_utils/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,7 @@ pub fn if_sequence<'tcx>(mut expr: &'tcx Expr<'tcx>) -> (Vec<&'tcx Expr<'tcx>>,
16901690

16911691
/// Checks if the given function kind is an async function.
16921692
pub fn is_async_fn(kind: FnKind<'_>) -> bool {
1693-
matches!(kind, FnKind::ItemFn(_, _, header, _) if header.asyncness == IsAsync::Async)
1693+
matches!(kind, FnKind::ItemFn(_, _, header) if header.asyncness == IsAsync::Async)
16941694
}
16951695

16961696
/// Peels away all the compiler generated code surrounding the body of an async function,

0 commit comments

Comments
 (0)