Skip to content

Commit d6b35f9

Browse files
Cameron SteffenCameron Steffen
authored andcommitted
add never_loop test
1 parent 346936a commit d6b35f9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/ui/never_loop.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,19 @@ pub fn test12(a: bool, b: bool) {
126126
}
127127
}
128128

129+
pub fn test13() {
130+
let mut a = true;
131+
loop { // infinite loop
132+
while a {
133+
if true {
134+
a = false;
135+
continue;
136+
}
137+
return;
138+
}
139+
}
140+
}
141+
129142
fn main() {
130143
test1();
131144
test2();
@@ -139,5 +152,6 @@ fn main() {
139152
test10();
140153
test11(|| 0);
141154
test12(true, false);
155+
test13();
142156
}
143157

0 commit comments

Comments
 (0)