about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/ui/cognitive_complexity.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/cognitive_complexity.rs b/tests/ui/cognitive_complexity.rs
index 2dbec955f63..88033a7b674 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;
+    }
+}