summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/fn_params_excessive_bools.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/fn_params_excessive_bools.rs')
-rw-r--r--src/tools/clippy/tests/ui/fn_params_excessive_bools.rs7
1 files changed, 7 insertions, 0 deletions
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 f53e53162..cc18708d2 100644
--- a/src/tools/clippy/tests/ui/fn_params_excessive_bools.rs
+++ b/src/tools/clippy/tests/ui/fn_params_excessive_bools.rs
@@ -17,22 +17,27 @@ foo!();
#[no_mangle]
extern "C" fn k(_: bool, _: bool, _: bool, _: bool) {}
fn g(_: bool, _: bool, _: bool, _: bool) {}
+//~^ ERROR: more than 3 bools in function parameters
fn h(_: bool, _: bool, _: bool) {}
fn e(_: S, _: S, _: Box<S>, _: Vec<u32>) {}
fn t(_: S, _: S, _: Box<S>, _: Vec<u32>, _: bool, _: bool, _: bool, _: bool) {}
+//~^ ERROR: more than 3 bools in function parameters
struct S;
trait Trait {
// should warn for trait functions with and without body
fn f(_: bool, _: bool, _: bool, _: bool);
+ //~^ ERROR: more than 3 bools in function parameters
fn g(_: bool, _: bool, _: bool, _: Vec<u32>);
#[allow(clippy::fn_params_excessive_bools)]
fn h(_: bool, _: bool, _: bool, _: bool, _: bool, _: bool);
fn i(_: bool, _: bool, _: bool, _: bool) {}
+ //~^ ERROR: more than 3 bools in function parameters
}
impl S {
fn f(&self, _: bool, _: bool, _: bool, _: bool) {}
+ //~^ ERROR: more than 3 bools in function parameters
fn g(&self, _: bool, _: bool, _: bool) {}
#[no_mangle]
extern "C" fn h(_: bool, _: bool, _: bool, _: bool) {}
@@ -48,6 +53,8 @@ impl Trait for S {
fn main() {
fn n(_: bool, _: u32, _: bool, _: Box<u32>, _: bool, _: bool) {
+ //~^ ERROR: more than 3 bools in function parameters
fn nn(_: bool, _: bool, _: bool, _: bool) {}
+ //~^ ERROR: more than 3 bools in function parameters
}
}