Skip to content

Commit d22a9fe

Browse files
committed
Merged
tests/ui/for-loop-while/break-continue-in-loop-while-contiditoin-1.rs with tests/ui/for-loop-while/break-continue-in-loop-while-contiditoin-2.rs
1 parent 17e6c92 commit d22a9fe

File tree

4 files changed

+45
-36
lines changed

4 files changed

+45
-36
lines changed

tests/ui/for-loop-while/break-continue-in-loop-while-condition-2.rs

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/ui/for-loop-while/break-continue-in-loop-while-condition-2.stderr

Lines changed: 0 additions & 9 deletions
This file was deleted.

tests/ui/for-loop-while/break-continue-in-loop-while-condition-1.rs renamed to tests/ui/for-loop-while/break-continue-in-loop-while-condition.rs

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//! regression test for #37576, #50802
2+
//! Tests that using unlabeled `break` or `continue` within a loop or while's condition.
3+
14
fn main() {
25
'test_1: while break 'test_1 {}
36
while break {}
@@ -7,9 +10,13 @@ fn main() {
710
while let true = break {}
811
//~^ ERROR `break` or `continue` with no label
912

10-
loop { 'test_3: while break 'test_3 {} }
11-
loop { while break {} }
12-
//~^ ERROR `break` or `continue` with no label
13+
loop {
14+
'test_3: while break 'test_3 {}
15+
}
16+
loop {
17+
while break {}
18+
//~^ ERROR `break` or `continue` with no label
19+
}
1320

1421
loop {
1522
'test_4: while break 'test_4 {}
@@ -29,9 +36,13 @@ fn main() {
2936
while let true = continue {}
3037
//~^ ERROR `break` or `continue` with no label
3138

32-
loop { 'test_7: while continue 'test_7 {} }
33-
loop { while continue {} }
34-
//~^ ERROR `break` or `continue` with no label
39+
loop {
40+
'test_7: while continue 'test_7 {}
41+
}
42+
loop {
43+
while continue {}
44+
//~^ ERROR `break` or `continue` with no label
45+
}
3546

3647
loop {
3748
'test_8: while continue 'test_8 {}
@@ -42,4 +53,13 @@ fn main() {
4253
//~^ ERROR `break` or `continue` with no label
4354
continue;
4455
}
56+
57+
'test_9: loop {
58+
break while continue 'test_9 {};
59+
}
60+
loop {
61+
break while continue {
62+
//~^ ERROR `break` or `continue` with no label
63+
};
64+
}
4565
}
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,57 @@
11
error[E0590]: `break` or `continue` with no label in the condition of a `while` loop
2-
--> $DIR/issue-37576.rs:3:11
2+
--> $DIR/break-continue-in-loop-while-condition.rs:6:11
33
|
44
LL | while break {}
55
| ^^^^^ unlabeled `break` in the condition of a `while` loop
66

77
error[E0590]: `break` or `continue` with no label in the condition of a `while` loop
8-
--> $DIR/issue-37576.rs:7:22
8+
--> $DIR/break-continue-in-loop-while-condition.rs:10:22
99
|
1010
LL | while let true = break {}
1111
| ^^^^^ unlabeled `break` in the condition of a `while` loop
1212

1313
error[E0590]: `break` or `continue` with no label in the condition of a `while` loop
14-
--> $DIR/issue-37576.rs:11:18
14+
--> $DIR/break-continue-in-loop-while-condition.rs:17:15
1515
|
16-
LL | loop { while break {} }
17-
| ^^^^^ unlabeled `break` in the condition of a `while` loop
16+
LL | while break {}
17+
| ^^^^^ unlabeled `break` in the condition of a `while` loop
1818

1919
error[E0590]: `break` or `continue` with no label in the condition of a `while` loop
20-
--> $DIR/issue-37576.rs:19:15
20+
--> $DIR/break-continue-in-loop-while-condition.rs:26:15
2121
|
2222
LL | while break {}
2323
| ^^^^^ unlabeled `break` in the condition of a `while` loop
2424

2525
error[E0590]: `break` or `continue` with no label in the condition of a `while` loop
26-
--> $DIR/issue-37576.rs:25:11
26+
--> $DIR/break-continue-in-loop-while-condition.rs:32:11
2727
|
2828
LL | while continue {}
2929
| ^^^^^^^^ unlabeled `continue` in the condition of a `while` loop
3030

3131
error[E0590]: `break` or `continue` with no label in the condition of a `while` loop
32-
--> $DIR/issue-37576.rs:29:22
32+
--> $DIR/break-continue-in-loop-while-condition.rs:36:22
3333
|
3434
LL | while let true = continue {}
3535
| ^^^^^^^^ unlabeled `continue` in the condition of a `while` loop
3636

3737
error[E0590]: `break` or `continue` with no label in the condition of a `while` loop
38-
--> $DIR/issue-37576.rs:33:18
38+
--> $DIR/break-continue-in-loop-while-condition.rs:43:15
3939
|
40-
LL | loop { while continue {} }
41-
| ^^^^^^^^ unlabeled `continue` in the condition of a `while` loop
40+
LL | while continue {}
41+
| ^^^^^^^^ unlabeled `continue` in the condition of a `while` loop
4242

4343
error[E0590]: `break` or `continue` with no label in the condition of a `while` loop
44-
--> $DIR/issue-37576.rs:41:15
44+
--> $DIR/break-continue-in-loop-while-condition.rs:52:15
4545
|
4646
LL | while continue {}
4747
| ^^^^^^^^ unlabeled `continue` in the condition of a `while` loop
4848

49-
error: aborting due to 8 previous errors
49+
error[E0590]: `break` or `continue` with no label in the condition of a `while` loop
50+
--> $DIR/break-continue-in-loop-while-condition.rs:61:21
51+
|
52+
LL | break while continue {
53+
| ^^^^^^^^ unlabeled `continue` in the condition of a `while` loop
54+
55+
error: aborting due to 9 previous errors
5056

5157
For more information about this error, try `rustc --explain E0590`.

0 commit comments

Comments
 (0)