From 4547b622d8d29df964fa2914213088b148c498fc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:32 +0200 Subject: Merging upstream version 1.67.1+dfsg1. Signed-off-by: Daniel Baumann --- src/tools/clippy/tests/ui/fn_params_excessive_bools.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/tools/clippy/tests/ui/fn_params_excessive_bools.rs') diff --git a/src/tools/clippy/tests/ui/fn_params_excessive_bools.rs b/src/tools/clippy/tests/ui/fn_params_excessive_bools.rs index f805bcc9b..f53e53162 100644 --- a/src/tools/clippy/tests/ui/fn_params_excessive_bools.rs +++ b/src/tools/clippy/tests/ui/fn_params_excessive_bools.rs @@ -2,6 +2,7 @@ #![allow(clippy::too_many_arguments)] extern "C" { + // Should not lint, most of the time users have no control over extern function signatures fn f(_: bool, _: bool, _: bool, _: bool); } @@ -22,8 +23,12 @@ fn t(_: S, _: S, _: Box, _: Vec, _: bool, _: bool, _: bool, _: bool) {} struct S; trait Trait { + // should warn for trait functions with and without body fn f(_: bool, _: bool, _: bool, _: bool); fn g(_: bool, _: bool, _: bool, _: Vec); + #[allow(clippy::fn_params_excessive_bools)] + fn h(_: bool, _: bool, _: bool, _: bool, _: bool, _: bool); + fn i(_: bool, _: bool, _: bool, _: bool) {} } impl S { @@ -34,8 +39,11 @@ impl S { } impl Trait for S { + // Should not lint because the trait might not be changeable by the user + // We only lint in the trait definition fn f(_: bool, _: bool, _: bool, _: bool) {} fn g(_: bool, _: bool, _: bool, _: Vec) {} + fn h(_: bool, _: bool, _: bool, _: bool, _: bool, _: bool) {} } fn main() { -- cgit v1.2.3