1 error: this `if` has identical blocks
2 --> $DIR/copies.rs:31:10
4 31 | else { //~ ERROR same body as `if` block
6 32 | | Foo { bar: 42 };
14 = note: `-D if-same-then-else` implied by `-D warnings`
16 --> $DIR/copies.rs:22:13
20 23 | | Foo { bar: 42 };
28 error: this `match` has identical arm bodies
29 --> $DIR/copies.rs:80:14
31 80 | _ => { //~ ERROR match arms have same body
34 82 | | let mut a = 42 + [23].len() as i32;
41 = note: `-D match-same-arms` implied by `-D warnings`
43 --> $DIR/copies.rs:71:15
48 73 | | let mut a = 42 + [23].len() as i32;
54 note: `42` has the same arm body as the `_` wildcard, consider removing it`
55 --> $DIR/copies.rs:71:15
60 73 | | let mut a = 42 + [23].len() as i32;
67 error: this `match` has identical arm bodies
68 --> $DIR/copies.rs:94:14
70 94 | _ => 0, //~ ERROR match arms have same body
74 --> $DIR/copies.rs:92:19
78 note: `Abc::A` has the same arm body as the `_` wildcard, consider removing it`
79 --> $DIR/copies.rs:92:19
84 error: this `if` has identical blocks
85 --> $DIR/copies.rs:104:10
87 104 | else { //~ ERROR same body as `if` block
94 --> $DIR/copies.rs:101:21
96 101 | let _ = if true {
97 | _____________________^
102 error: this `if` has identical blocks
103 --> $DIR/copies.rs:118:10
105 118 | else { //~ ERROR same body as `if` block
107 119 | | for _ in &[42] {
108 120 | | let foo: &Option<_> = &Some::<u8>(42);
116 --> $DIR/copies.rs:108:13
120 109 | | for _ in &[42] {
121 110 | | let foo: &Option<_> = &Some::<u8>(42);
128 error: this `if` has identical blocks
129 --> $DIR/copies.rs:140:10
131 140 | else { //~ ERROR same body as `if` block
133 141 | | let bar = if true {
142 --> $DIR/copies.rs:129:13
146 130 | | let bar = if true {
154 error: this `if` has identical blocks
155 --> $DIR/copies.rs:163:19
157 163 | else if foo() { //~ ERROR same body as `if` block
158 | ___________________^
159 164 | | let _ = match 42 {
161 166 | | a if a > 0 => 2,
168 --> $DIR/copies.rs:152:13
172 153 | | let _ = match 42 {
174 155 | | a if a > 0 => 2,
180 error: this `if` has identical blocks
181 --> $DIR/copies.rs:175:10
183 175 | else { //~ ERROR same body as `if` block
185 176 | | if let Some(a) = Some(42) {}
190 --> $DIR/copies.rs:172:13
194 173 | | if let Some(a) = Some(42) {}
198 error: this `if` has identical blocks
199 --> $DIR/copies.rs:182:10
201 182 | else { //~ ERROR same body as `if` block
203 183 | | if let (1, .., 3) = (1, 2, 3) {}
208 --> $DIR/copies.rs:179:13
212 180 | | if let (1, .., 3) = (1, 2, 3) {}
216 error: this `match` has identical arm bodies
217 --> $DIR/copies.rs:237:15
219 237 | 51 => foo(), //~ ERROR match arms have same body
223 --> $DIR/copies.rs:236:15
227 note: consider refactoring into `42 | 51`
228 --> $DIR/copies.rs:236:15
233 error: this `match` has identical arm bodies
234 --> $DIR/copies.rs:243:17
236 243 | None => 24, //~ ERROR match arms have same body
240 --> $DIR/copies.rs:242:20
244 note: consider refactoring into `Some(_) | None`
245 --> $DIR/copies.rs:242:20
250 error: this `match` has identical arm bodies
251 --> $DIR/copies.rs:265:28
253 265 | (None, Some(a)) => bar(a), //~ ERROR match arms have same body
257 --> $DIR/copies.rs:264:28
259 264 | (Some(a), None) => bar(a),
261 note: consider refactoring into `(Some(a), None) | (None, Some(a))`
262 --> $DIR/copies.rs:264:28
264 264 | (Some(a), None) => bar(a),
267 error: this `match` has identical arm bodies
268 --> $DIR/copies.rs:271:26
270 271 | (.., Some(a)) => bar(a), //~ ERROR match arms have same body
274 --> $DIR/copies.rs:270:26
276 270 | (Some(a), ..) => bar(a),
278 note: consider refactoring into `(Some(a), ..) | (.., Some(a))`
279 --> $DIR/copies.rs:270:26
281 270 | (Some(a), ..) => bar(a),
284 error: this `match` has identical arm bodies
285 --> $DIR/copies.rs:277:20
287 277 | (.., 3) => 42, //~ ERROR match arms have same body
291 --> $DIR/copies.rs:276:23
293 276 | (1, .., 3) => 42,
295 note: consider refactoring into `(1, .., 3) | (.., 3)`
296 --> $DIR/copies.rs:276:23
298 276 | (1, .., 3) => 42,
301 error: this `if` has identical blocks
302 --> $DIR/copies.rs:283:12
304 283 | } else { //~ ERROR same body as `if` block
311 --> $DIR/copies.rs:281:21
313 281 | let _ = if true {
314 | _____________________^
316 283 | | } else { //~ ERROR same body as `if` block
319 error: this `if` has identical blocks
320 --> $DIR/copies.rs:289:12
322 289 | } else { //~ ERROR same body as `if` block
329 --> $DIR/copies.rs:287:21
331 287 | let _ = if true {
332 | _____________________^
334 289 | | } else { //~ ERROR same body as `if` block
337 error: this `if` has identical blocks
338 --> $DIR/copies.rs:309:12
340 309 | } else { //~ ERROR same body as `if` block
342 310 | | std::f32::NAN
347 --> $DIR/copies.rs:307:21
349 307 | let _ = if true {
350 | _____________________^
351 308 | | std::f32::NAN
352 309 | | } else { //~ ERROR same body as `if` block
355 error: this `if` has identical blocks
356 --> $DIR/copies.rs:327:10
358 327 | else { //~ ERROR same body as `if` block
360 328 | | try!(Ok("foo"));
365 --> $DIR/copies.rs:324:13
369 325 | | try!(Ok("foo"));
373 error: this `if` has identical blocks
374 --> $DIR/copies.rs:339:10
376 339 | else { //~ ERROR same body as `if` block
378 340 | | let foo = "";
379 341 | | return Ok(&foo[0..]);
384 --> $DIR/copies.rs:331:13
388 332 | | let foo = "";
389 333 | | return Ok(&foo[0..]);
393 error: this `if` has the same condition as a previous if
394 --> $DIR/copies.rs:353:13
396 353 | else if b { //~ ERROR ifs same condition
399 = note: `-D ifs-same-cond` implied by `-D warnings`
401 --> $DIR/copies.rs:351:8
406 error: this `if` has the same condition as a previous if
407 --> $DIR/copies.rs:358:13
409 358 | else if a == 1 { //~ ERROR ifs same condition
413 --> $DIR/copies.rs:356:8
418 error: this `if` has the same condition as a previous if
419 --> $DIR/copies.rs:365:13
421 365 | else if 2*a == 1 { //~ ERROR ifs same condition
425 --> $DIR/copies.rs:361:8
430 error: aborting due to 22 previous errors