Skip to content

Commit 1f458c6

Browse files
authored
Rollup merge of #149498 - reddevilmidzy:t8, r=fee1-dead
Tidying up `tests/ui/issues` tests [1/N] > [!NOTE] > Intermediate commits are intended to help review, but will be squashed add comment commit prior to merge. part of #133895
2 parents 842f95d + 79893a0 commit 1f458c6

18 files changed

+105
-127
lines changed

tests/ui/box/self-assignment.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ run-pass
2+
//! regression test for <https://github.com/rust-lang/rust/issues/3290>
3+
4+
#![allow(dead_code)]
5+
6+
pub fn main() {
7+
let mut x: Box<_> = Box::new(3);
8+
x = x;
9+
assert_eq!(*x, 3);
10+
}

tests/ui/empty/empty-struct-unit-expr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Can't use unit struct as constructor function
2+
// related issue <https://github.com/rust-lang/rust/issues/20714>
23

34
//@ aux-build:empty-struct.rs
45

@@ -8,7 +9,7 @@ use empty_struct::*;
89
struct Empty2;
910

1011
enum E {
11-
Empty4
12+
Empty4,
1213
}
1314

1415
fn main() {

tests/ui/empty/empty-struct-unit-expr.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0618]: expected function, found struct `Empty2`
2-
--> $DIR/empty-struct-unit-expr.rs:15:14
2+
--> $DIR/empty-struct-unit-expr.rs:16:14
33
|
44
LL | struct Empty2;
55
| ------------- struct `Empty2` defined here
@@ -16,9 +16,9 @@ LL + let e2 = Empty2;
1616
|
1717

1818
error[E0618]: expected function, found enum variant `E::Empty4`
19-
--> $DIR/empty-struct-unit-expr.rs:16:14
19+
--> $DIR/empty-struct-unit-expr.rs:17:14
2020
|
21-
LL | Empty4
21+
LL | Empty4,
2222
| ------ enum variant `E::Empty4` defined here
2323
...
2424
LL | let e4 = E::Empty4();
@@ -33,7 +33,7 @@ LL + let e4 = E::Empty4;
3333
|
3434

3535
error[E0618]: expected function, found struct `XEmpty2`
36-
--> $DIR/empty-struct-unit-expr.rs:18:15
36+
--> $DIR/empty-struct-unit-expr.rs:19:15
3737
|
3838
LL | let xe2 = XEmpty2();
3939
| ^^^^^^^--
@@ -47,7 +47,7 @@ LL + let xe2 = XEmpty2;
4747
|
4848

4949
error[E0618]: expected function, found enum variant `XE::XEmpty4`
50-
--> $DIR/empty-struct-unit-expr.rs:19:15
50+
--> $DIR/empty-struct-unit-expr.rs:20:15
5151
|
5252
LL | let xe4 = XE::XEmpty4();
5353
| ^^^^^^^^^^^--

tests/ui/issues/issue-37576.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
}
Lines changed: 19 additions & 13 deletions
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`.

tests/ui/issues/issue-20714.rs

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

tests/ui/issues/issue-20714.stderr

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

tests/ui/issues/issue-2383.rs

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

tests/ui/issues/issue-2951.rs

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

tests/ui/issues/issue-2951.stderr

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

0 commit comments

Comments
 (0)