Skip to content

Commit 3ac2957

Browse files
committed
Update tests to new format of multiline errors
1 parent 5cbe9b5 commit 3ac2957

26 files changed

+355
-478
lines changed

tests/ui/arithmetic.stderr

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ error: integer arithmetic detected
1919
error: integer arithmetic detected
2020
--> $DIR/arithmetic.rs:10:5
2121
|
22-
10 | 1 %
23-
| _____^ starting here...
22+
10 | / 1 %
2423
11 | | i / 2; // no error, this is part of the expression in the preceding line
25-
| |_________^ ...ending here
24+
| |_________^
2625

2726
error: integer arithmetic detected
2827
--> $DIR/arithmetic.rs:12:5

tests/ui/block_in_if_condition.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ error: in an 'if' condition, avoid complex blocks or closures with blocks; inste
22
--> $DIR/block_in_if_condition.rs:30:8
33
|
44
30 | if {
5-
| ________^ starting here...
5+
| ________^
66
31 | | let x = 3;
77
32 | | x == 3
88
33 | | } {
9-
| |_____^ ...ending here
9+
| |_____^
1010
|
1111
note: lint level defined here
1212
--> $DIR/block_in_if_condition.rs:5:9

tests/ui/collapsible_if.stderr

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
error: this if statement can be collapsed
22
--> $DIR/collapsible_if.rs:8:5
33
|
4-
8 | if x == "hello" {
5-
| _____^ starting here...
4+
8 | / if x == "hello" {
65
9 | |
76
10 | |
87
11 | |
98
... |
109
14 | | }
1110
15 | | }
12-
| |_____^ ...ending here
11+
| |_____^
1312
|
1413
note: lint level defined here
1514
--> $DIR/collapsible_if.rs:4:8
@@ -24,15 +23,14 @@ help: try
2423
error: this if statement can be collapsed
2524
--> $DIR/collapsible_if.rs:17:5
2625
|
27-
17 | if x == "hello" || x == "world" {
28-
| _____^ starting here...
26+
17 | / if x == "hello" || x == "world" {
2927
18 | |
3028
19 | |
3129
20 | |
3230
... |
3331
23 | | }
3432
24 | | }
35-
| |_____^ ...ending here
33+
| |_____^
3634
|
3735
help: try
3836
| if (x == "hello" || x == "world") && (y == "world" || y == "hello") {
@@ -42,15 +40,14 @@ help: try
4240
error: this if statement can be collapsed
4341
--> $DIR/collapsible_if.rs:26:5
4442
|
45-
26 | if x == "hello" && x == "world" {
46-
| _____^ starting here...
43+
26 | / if x == "hello" && x == "world" {
4744
27 | |
4845
28 | |
4946
29 | |
5047
... |
5148
32 | | }
5249
33 | | }
53-
| |_____^ ...ending here
50+
| |_____^
5451
|
5552
help: try
5653
| if x == "hello" && x == "world" && (y == "world" || y == "hello") {
@@ -60,15 +57,14 @@ help: try
6057
error: this if statement can be collapsed
6158
--> $DIR/collapsible_if.rs:35:5
6259
|
63-
35 | if x == "hello" || x == "world" {
64-
| _____^ starting here...
60+
35 | / if x == "hello" || x == "world" {
6561
36 | |
6662
37 | |
6763
38 | |
6864
... |
6965
41 | | }
7066
42 | | }
71-
| |_____^ ...ending here
67+
| |_____^
7268
|
7369
help: try
7470
| if (x == "hello" || x == "world") && y == "world" && y == "hello" {
@@ -78,15 +74,14 @@ help: try
7874
error: this if statement can be collapsed
7975
--> $DIR/collapsible_if.rs:44:5
8076
|
81-
44 | if x == "hello" && x == "world" {
82-
| _____^ starting here...
77+
44 | / if x == "hello" && x == "world" {
8378
45 | |
8479
46 | |
8580
47 | |
8681
... |
8782
50 | | }
8883
51 | | }
89-
| |_____^ ...ending here
84+
| |_____^
9085
|
9186
help: try
9287
| if x == "hello" && x == "world" && y == "world" && y == "hello" {
@@ -96,15 +91,14 @@ help: try
9691
error: this if statement can be collapsed
9792
--> $DIR/collapsible_if.rs:53:5
9893
|
99-
53 | if 42 == 1337 {
100-
| _____^ starting here...
94+
53 | / if 42 == 1337 {
10195
54 | |
10296
55 | |
10397
56 | |
10498
... |
10599
59 | | }
106100
60 | | }
107-
| |_____^ ...ending here
101+
| |_____^
108102
|
109103
help: try
110104
| if 42 == 1337 && 'a' != 'A' {
@@ -115,14 +109,14 @@ error: this `else { if .. }` block can be collapsed
115109
--> $DIR/collapsible_if.rs:65:12
116110
|
117111
65 | } else {
118-
| ____________^ starting here...
112+
| ____________^
119113
66 | |
120114
67 | |
121115
68 | |
122116
... |
123117
71 | | }
124118
72 | | }
125-
| |_____^ ...ending here
119+
| |_____^
126120
|
127121
help: try
128122
| } else if y == "world" {
@@ -133,14 +127,14 @@ error: this `else { if .. }` block can be collapsed
133127
--> $DIR/collapsible_if.rs:76:12
134128
|
135129
76 | } else {
136-
| ____________^ starting here...
130+
| ____________^
137131
77 | |
138132
78 | |
139133
79 | |
140134
... |
141135
82 | | }
142136
83 | | }
143-
| |_____^ ...ending here
137+
| |_____^
144138
|
145139
help: try
146140
| } else if let Some(42) = Some(42) {
@@ -151,14 +145,14 @@ error: this `else { if .. }` block can be collapsed
151145
--> $DIR/collapsible_if.rs:87:12
152146
|
153147
87 | } else {
154-
| ____________^ starting here...
148+
| ____________^
155149
88 | |
156150
89 | |
157151
90 | |
158152
... |
159153
96 | | }
160154
97 | | }
161-
| |_____^ ...ending here
155+
| |_____^
162156
|
163157
help: try
164158
| } else if y == "world" {
@@ -172,14 +166,14 @@ error: this `else { if .. }` block can be collapsed
172166
--> $DIR/collapsible_if.rs:101:12
173167
|
174168
101 | } else {
175-
| ____________^ starting here...
169+
| ____________^
176170
102 | |
177171
103 | |
178172
104 | |
179173
... |
180174
110 | | }
181175
111 | | }
182-
| |_____^ ...ending here
176+
| |_____^
183177
|
184178
help: try
185179
| } else if let Some(42) = Some(42) {
@@ -193,14 +187,14 @@ error: this `else { if .. }` block can be collapsed
193187
--> $DIR/collapsible_if.rs:115:12
194188
|
195189
115 | } else {
196-
| ____________^ starting here...
190+
| ____________^
197191
116 | |
198192
117 | |
199193
118 | |
200194
... |
201195
124 | | }
202196
125 | | }
203-
| |_____^ ...ending here
197+
| |_____^
204198
|
205199
help: try
206200
| } else if let Some(42) = Some(42) {
@@ -214,14 +208,14 @@ error: this `else { if .. }` block can be collapsed
214208
--> $DIR/collapsible_if.rs:129:12
215209
|
216210
129 | } else {
217-
| ____________^ starting here...
211+
| ____________^
218212
130 | |
219213
131 | |
220214
132 | |
221215
... |
222216
138 | | }
223217
139 | | }
224-
| |_____^ ...ending here
218+
| |_____^
225219
|
226220
help: try
227221
| } else if x == "hello" {
@@ -235,14 +229,14 @@ error: this `else { if .. }` block can be collapsed
235229
--> $DIR/collapsible_if.rs:143:12
236230
|
237231
143 | } else {
238-
| ____________^ starting here...
232+
| ____________^
239233
144 | |
240234
145 | |
241235
146 | |
242236
... |
243237
152 | | }
244238
153 | | }
245-
| |_____^ ...ending here
239+
| |_____^
246240
|
247241
help: try
248242
| } else if let Some(42) = Some(42) {

0 commit comments

Comments
 (0)