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