diff --git a/tests/ui/cognitive_complexity.rs b/tests/ui/cognitive_complexity.rs index 2dbec955f63f..88033a7b6741 100644 --- a/tests/ui/cognitive_complexity.rs +++ b/tests/ui/cognitive_complexity.rs @@ -448,3 +448,20 @@ mod issue9300 { } } } + +#[clippy::cognitive_complexity = "2"] +mod issue14422 { + fn foo() { + for _ in 0..10 { + println!("hello there"); + } + } + + fn bar() { + for _ in 0..10 { + println!("hello there"); + } + return; + return; + } +}