[fn_params_excessive_bools] whitelist in signle function in test

This commit is contained in:
kraktus 2022-10-29 17:43:43 +02:00
parent 9e1c7febe2
commit 13b737d5b8
2 changed files with 6 additions and 3 deletions

View File

@ -25,6 +25,8 @@ struct S;
trait Trait { trait Trait {
fn f(_: bool, _: bool, _: bool, _: bool); fn f(_: bool, _: bool, _: bool, _: bool);
fn g(_: bool, _: bool, _: bool, _: Vec<u32>); fn g(_: bool, _: bool, _: bool, _: Vec<u32>);
#[allow(clippy::fn_params_excessive_bools)]
fn h(_: bool, _: bool, _: bool, _: bool, _: bool, _: bool);
} }
impl S { impl S {
@ -39,6 +41,7 @@ impl Trait for S {
// We only lint in the trait definition // We only lint in the trait definition
fn f(_: bool, _: bool, _: bool, _: bool) {} fn f(_: bool, _: bool, _: bool, _: bool) {}
fn g(_: bool, _: bool, _: bool, _: Vec<u32>) {} fn g(_: bool, _: bool, _: bool, _: Vec<u32>) {}
fn h(_: bool, _: bool, _: bool, _: bool, _: bool, _: bool) {}
} }
fn main() { fn main() {

View File

@ -16,7 +16,7 @@ LL | fn t(_: S, _: S, _: Box<S>, _: Vec<u32>, _: bool, _: bool, _: bool, _: bool
= help: consider refactoring bools into two-variant enums = help: consider refactoring bools into two-variant enums
error: more than 3 bools in function parameters error: more than 3 bools in function parameters
--> $DIR/fn_params_excessive_bools.rs:31:5 --> $DIR/fn_params_excessive_bools.rs:33:5
| |
LL | fn f(&self, _: bool, _: bool, _: bool, _: bool) {} LL | fn f(&self, _: bool, _: bool, _: bool, _: bool) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -24,7 +24,7 @@ LL | fn f(&self, _: bool, _: bool, _: bool, _: bool) {}
= help: consider refactoring bools into two-variant enums = help: consider refactoring bools into two-variant enums
error: more than 3 bools in function parameters error: more than 3 bools in function parameters
--> $DIR/fn_params_excessive_bools.rs:45:5 --> $DIR/fn_params_excessive_bools.rs:48:5
| |
LL | / fn n(_: bool, _: u32, _: bool, _: Box<u32>, _: bool, _: bool) { LL | / fn n(_: bool, _: u32, _: bool, _: Box<u32>, _: bool, _: bool) {
LL | | fn nn(_: bool, _: bool, _: bool, _: bool) {} LL | | fn nn(_: bool, _: bool, _: bool, _: bool) {}
@ -34,7 +34,7 @@ LL | | }
= help: consider refactoring bools into two-variant enums = help: consider refactoring bools into two-variant enums
error: more than 3 bools in function parameters error: more than 3 bools in function parameters
--> $DIR/fn_params_excessive_bools.rs:46:9 --> $DIR/fn_params_excessive_bools.rs:49:9
| |
LL | fn nn(_: bool, _: bool, _: bool, _: bool) {} LL | fn nn(_: bool, _: bool, _: bool, _: bool) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^