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