]> git.lizzy.rs Git - rust.git/blob - tests/ui/copies.stderr
Rustup
[rust.git] / tests / ui / copies.stderr
1 error: this `if` has identical blocks
2   --> $DIR/copies.rs:29:10
3    |
4 29 |       else { //~ ERROR same body as `if` block
5    |  __________^
6 30 | |         Foo { bar: 42 };
7 31 | |         0..10;
8 32 | |         ..;
9 ...  |
10 36 | |         foo();
11 37 | |     }
12    | |_____^
13    |
14    = note: `-D if-same-then-else` implied by `-D warnings`
15 note: same as this
16   --> $DIR/copies.rs:20:13
17    |
18 20 |       if true {
19    |  _____________^
20 21 | |         Foo { bar: 42 };
21 22 | |         0..10;
22 23 | |         ..;
23 ...  |
24 27 | |         foo();
25 28 | |     }
26    | |_____^
27
28 error: this `match` has identical arm bodies
29   --> $DIR/copies.rs:78:14
30    |
31 78 |           _ => { //~ ERROR match arms have same body
32    |  ______________^
33 79 | |             foo();
34 80 | |             let mut a = 42 + [23].len() as i32;
35 81 | |             if true {
36 ...  |
37 85 | |             a
38 86 | |         }
39    | |_________^
40    |
41    = note: `-D match-same-arms` implied by `-D warnings`
42 note: same as this
43   --> $DIR/copies.rs:69:15
44    |
45 69 |           42 => {
46    |  _______________^
47 70 | |             foo();
48 71 | |             let mut a = 42 + [23].len() as i32;
49 72 | |             if true {
50 ...  |
51 76 | |             a
52 77 | |         }
53    | |_________^
54 note: `42` has the same arm body as the `_` wildcard, consider removing it`
55   --> $DIR/copies.rs:69:15
56    |
57 69 |           42 => {
58    |  _______________^
59 70 | |             foo();
60 71 | |             let mut a = 42 + [23].len() as i32;
61 72 | |             if true {
62 ...  |
63 76 | |             a
64 77 | |         }
65    | |_________^
66
67 error: this `match` has identical arm bodies
68   --> $DIR/copies.rs:92:14
69    |
70 92 |         _ => 0, //~ ERROR match arms have same body
71    |              ^
72    |
73 note: same as this
74   --> $DIR/copies.rs:90:19
75    |
76 90 |         Abc::A => 0,
77    |                   ^
78 note: `Abc::A` has the same arm body as the `_` wildcard, consider removing it`
79   --> $DIR/copies.rs:90:19
80    |
81 90 |         Abc::A => 0,
82    |                   ^
83
84 error: this `if` has identical blocks
85    --> $DIR/copies.rs:102:10
86     |
87 102 |       else { //~ ERROR same body as `if` block
88     |  __________^
89 103 | |         42
90 104 | |     };
91     | |_____^
92     |
93 note: same as this
94    --> $DIR/copies.rs:99:21
95     |
96 99  |       let _ = if true {
97     |  _____________________^
98 100 | |         42
99 101 | |     }
100     | |_____^
101
102 error: this `if` has identical blocks
103    --> $DIR/copies.rs:116:10
104     |
105 116 |       else { //~ ERROR same body as `if` block
106     |  __________^
107 117 | |         for _ in &[42] {
108 118 | |             let foo: &Option<_> = &Some::<u8>(42);
109 119 | |             if true {
110 ...   |
111 124 | |         }
112 125 | |     }
113     | |_____^
114     |
115 note: same as this
116    --> $DIR/copies.rs:106:13
117     |
118 106 |       if true {
119     |  _____________^
120 107 | |         for _ in &[42] {
121 108 | |             let foo: &Option<_> = &Some::<u8>(42);
122 109 | |             if true {
123 ...   |
124 114 | |         }
125 115 | |     }
126     | |_____^
127
128 error: this `if` has identical blocks
129    --> $DIR/copies.rs:138:10
130     |
131 138 |       else { //~ ERROR same body as `if` block
132     |  __________^
133 139 | |         let bar = if true {
134 140 | |             42
135 141 | |         }
136 ...   |
137 147 | |         bar + 1;
138 148 | |     }
139     | |_____^
140     |
141 note: same as this
142    --> $DIR/copies.rs:127:13
143     |
144 127 |       if true {
145     |  _____________^
146 128 | |         let bar = if true {
147 129 | |             42
148 130 | |         }
149 ...   |
150 136 | |         bar + 1;
151 137 | |     }
152     | |_____^
153
154 error: this `if` has identical blocks
155    --> $DIR/copies.rs:173:10
156     |
157 173 |       else { //~ ERROR same body as `if` block
158     |  __________^
159 174 | |         if let Some(a) = Some(42) {}
160 175 | |     }
161     | |_____^
162     |
163 note: same as this
164    --> $DIR/copies.rs:170:13
165     |
166 170 |       if true {
167     |  _____________^
168 171 | |         if let Some(a) = Some(42) {}
169 172 | |     }
170     | |_____^
171
172 error: this `if` has identical blocks
173    --> $DIR/copies.rs:180:10
174     |
175 180 |       else { //~ ERROR same body as `if` block
176     |  __________^
177 181 | |         if let (1, .., 3) = (1, 2, 3) {}
178 182 | |     }
179     | |_____^
180     |
181 note: same as this
182    --> $DIR/copies.rs:177:13
183     |
184 177 |       if true {
185     |  _____________^
186 178 | |         if let (1, .., 3) = (1, 2, 3) {}
187 179 | |     }
188     | |_____^
189
190 error: this `match` has identical arm bodies
191    --> $DIR/copies.rs:235:15
192     |
193 235 |         51 => foo(), //~ ERROR match arms have same body
194     |               ^^^^^
195     |
196 note: same as this
197    --> $DIR/copies.rs:234:15
198     |
199 234 |         42 => foo(),
200     |               ^^^^^
201 note: consider refactoring into `42 | 51`
202    --> $DIR/copies.rs:234:15
203     |
204 234 |         42 => foo(),
205     |               ^^^^^
206
207 error: this `match` has identical arm bodies
208    --> $DIR/copies.rs:241:17
209     |
210 241 |         None => 24, //~ ERROR match arms have same body
211     |                 ^^
212     |
213 note: same as this
214    --> $DIR/copies.rs:240:20
215     |
216 240 |         Some(_) => 24,
217     |                    ^^
218 note: consider refactoring into `Some(_) | None`
219    --> $DIR/copies.rs:240:20
220     |
221 240 |         Some(_) => 24,
222     |                    ^^
223
224 error: this `match` has identical arm bodies
225    --> $DIR/copies.rs:263:28
226     |
227 263 |         (None, Some(a)) => bar(a), //~ ERROR match arms have same body
228     |                            ^^^^^^
229     |
230 note: same as this
231    --> $DIR/copies.rs:262:28
232     |
233 262 |         (Some(a), None) => bar(a),
234     |                            ^^^^^^
235 note: consider refactoring into `(Some(a), None) | (None, Some(a))`
236    --> $DIR/copies.rs:262:28
237     |
238 262 |         (Some(a), None) => bar(a),
239     |                            ^^^^^^
240
241 error: this `match` has identical arm bodies
242    --> $DIR/copies.rs:269:26
243     |
244 269 |         (.., Some(a)) => bar(a), //~ ERROR match arms have same body
245     |                          ^^^^^^
246     |
247 note: same as this
248    --> $DIR/copies.rs:268:26
249     |
250 268 |         (Some(a), ..) => bar(a),
251     |                          ^^^^^^
252 note: consider refactoring into `(Some(a), ..) | (.., Some(a))`
253    --> $DIR/copies.rs:268:26
254     |
255 268 |         (Some(a), ..) => bar(a),
256     |                          ^^^^^^
257
258 error: this `match` has identical arm bodies
259    --> $DIR/copies.rs:275:20
260     |
261 275 |         (.., 3) => 42, //~ ERROR match arms have same body
262     |                    ^^
263     |
264 note: same as this
265    --> $DIR/copies.rs:274:23
266     |
267 274 |         (1, .., 3) => 42,
268     |                       ^^
269 note: consider refactoring into `(1, .., 3) | (.., 3)`
270    --> $DIR/copies.rs:274:23
271     |
272 274 |         (1, .., 3) => 42,
273     |                       ^^
274
275 error: this `if` has identical blocks
276    --> $DIR/copies.rs:281:12
277     |
278 281 |       } else { //~ ERROR same body as `if` block
279     |  ____________^
280 282 | |         0.0
281 283 | |     };
282     | |_____^
283     |
284 note: same as this
285    --> $DIR/copies.rs:279:21
286     |
287 279 |       let _ = if true {
288     |  _____________________^
289 280 | |         0.0
290 281 | |     } else { //~ ERROR same body as `if` block
291     | |_____^
292
293 error: this `if` has identical blocks
294    --> $DIR/copies.rs:287:12
295     |
296 287 |       } else { //~ ERROR same body as `if` block
297     |  ____________^
298 288 | |         -0.0
299 289 | |     };
300     | |_____^
301     |
302 note: same as this
303    --> $DIR/copies.rs:285:21
304     |
305 285 |       let _ = if true {
306     |  _____________________^
307 286 | |         -0.0
308 287 | |     } else { //~ ERROR same body as `if` block
309     | |_____^
310
311 error: this `if` has identical blocks
312    --> $DIR/copies.rs:307:12
313     |
314 307 |       } else { //~ ERROR same body as `if` block
315     |  ____________^
316 308 | |         std::f32::NAN
317 309 | |     };
318     | |_____^
319     |
320 note: same as this
321    --> $DIR/copies.rs:305:21
322     |
323 305 |       let _ = if true {
324     |  _____________________^
325 306 | |         std::f32::NAN
326 307 | |     } else { //~ ERROR same body as `if` block
327     | |_____^
328
329 error: this `if` has identical blocks
330    --> $DIR/copies.rs:325:10
331     |
332 325 |       else { //~ ERROR same body as `if` block
333     |  __________^
334 326 | |         try!(Ok("foo"));
335 327 | |     }
336     | |_____^
337     |
338 note: same as this
339    --> $DIR/copies.rs:322:13
340     |
341 322 |       if true {
342     |  _____________^
343 323 | |         try!(Ok("foo"));
344 324 | |     }
345     | |_____^
346
347 error: this `if` has the same condition as a previous if
348    --> $DIR/copies.rs:351:13
349     |
350 351 |     else if b { //~ ERROR ifs same condition
351     |             ^
352     |
353     = note: `-D ifs-same-cond` implied by `-D warnings`
354 note: same as this
355    --> $DIR/copies.rs:349:8
356     |
357 349 |     if b {
358     |        ^
359
360 error: this `if` has the same condition as a previous if
361    --> $DIR/copies.rs:356:13
362     |
363 356 |     else if a == 1 { //~ ERROR ifs same condition
364     |             ^^^^^^
365     |
366 note: same as this
367    --> $DIR/copies.rs:354:8
368     |
369 354 |     if a == 1 {
370     |        ^^^^^^
371
372 error: this `if` has the same condition as a previous if
373    --> $DIR/copies.rs:363:13
374     |
375 363 |     else if 2*a == 1 { //~ ERROR ifs same condition
376     |             ^^^^^^^^
377     |
378 note: same as this
379    --> $DIR/copies.rs:359:8
380     |
381 359 |     if 2*a == 1 {
382     |        ^^^^^^^^
383
384 error: aborting due to 20 previous errors
385