Skip to content

Commit 01f299b

Browse files
committed
Add more test for #1586.
1 parent 4edfcb3 commit 01f299b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

clippy_tests/examples/never_loop.rs

+10
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ fn test10() {
103103
}
104104
}
105105

106+
fn test11<F: FnMut() -> i32>(mut f: F) {
107+
loop {
108+
return match f() {
109+
1 => continue,
110+
_ => (),
111+
}
112+
}
113+
}
114+
106115
fn main() {
107116
test1();
108117
test2();
@@ -114,5 +123,6 @@ fn main() {
114123
test8();
115124
test9();
116125
test10();
126+
test11(|| 0);
117127
}
118128

0 commit comments

Comments
 (0)