mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 09:38:26 +03:00
Change Test for Issue 14422 (Cognitive Complexity lowered through multiple returns) to test it does'nt regress to false negative
This commit is contained in:
@@ -454,15 +454,17 @@ pub async fn async_method() {
|
||||
}
|
||||
}
|
||||
|
||||
#[clippy::cognitive_complexity = "2"]
|
||||
#[clippy::cognitive_complexity = "1"]
|
||||
mod issue14422 {
|
||||
fn foo() {
|
||||
//~^ cognitive_complexity
|
||||
for _ in 0..10 {
|
||||
println!("hello there");
|
||||
}
|
||||
}
|
||||
|
||||
fn bar() {
|
||||
//~^ cognitive_complexity
|
||||
for _ in 0..10 {
|
||||
println!("hello there");
|
||||
}
|
||||
|
||||
@@ -160,5 +160,21 @@ LL | pub async fn async_method() {
|
||||
|
|
||||
= help: you could split it up into multiple smaller functions
|
||||
|
||||
error: aborting due to 20 previous errors
|
||||
error: the function has a cognitive complexity of (2/1)
|
||||
--> tests/ui/cognitive_complexity.rs:459:8
|
||||
|
|
||||
LL | fn foo() {
|
||||
| ^^^
|
||||
|
|
||||
= help: you could split it up into multiple smaller functions
|
||||
|
||||
error: the function has a cognitive complexity of (2/1)
|
||||
--> tests/ui/cognitive_complexity.rs:466:8
|
||||
|
|
||||
LL | fn bar() {
|
||||
| ^^^
|
||||
|
|
||||
= help: you could split it up into multiple smaller functions
|
||||
|
||||
error: aborting due to 22 previous errors
|
||||
|
||||
|
||||
Reference in New Issue
Block a user