1 error: this `if` has identical blocks
2 --> $DIR/copies.rs:50:12
6 51 | | //~ ERROR same body as `if` block
7 52 | | Foo { bar: 42 };
14 = note: `-D clippy::if-same-then-else` implied by `-D warnings`
16 --> $DIR/copies.rs:42:13
20 43 | | Foo { bar: 42 };
28 error: this `match` has identical arm bodies
29 --> $DIR/copies.rs:96:14
33 97 | | //~ ERROR match arms have same body
35 99 | | let mut a = 42 + [23].len() as i32;
41 = note: `-D clippy::match-same-arms` implied by `-D warnings`
43 --> $DIR/copies.rs:87:15
48 89 | | 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:87:15
60 89 | | let mut a = 42 + [23].len() as i32;
67 error: this `match` has identical arm bodies
68 --> $DIR/copies.rs:111:14
70 111 | _ => 0, //~ ERROR match arms have same body
74 --> $DIR/copies.rs:109:19
78 note: `Abc::A` has the same arm body as the `_` wildcard, consider removing it`
79 --> $DIR/copies.rs:109:19
84 error: this `if` has identical blocks
85 --> $DIR/copies.rs:120:12
89 121 | | //~ ERROR same body as `if` block
95 --> $DIR/copies.rs:118:21
97 118 | let _ = if true {
98 | _____________________^
103 error: this `if` has identical blocks
104 --> $DIR/copies.rs:134:12
108 135 | | //~ ERROR same body as `if` block
109 136 | | for _ in &[42] {
110 137 | | let foo: &Option<_> = &Some::<u8>(42);
117 --> $DIR/copies.rs:125:13
121 126 | | for _ in &[42] {
122 127 | | let foo: &Option<_> = &Some::<u8>(42);
129 error: this `if` has identical blocks
130 --> $DIR/copies.rs:153:12
134 154 | | //~ ERROR same body as `if` block
135 155 | | let bar = if true { 42 } else { 43 };
143 --> $DIR/copies.rs:146:13
147 147 | | let bar = if true { 42 } else { 43 };
149 149 | | while foo() {
155 error: this `if` has identical blocks
156 --> $DIR/copies.rs:183:12
160 184 | | //~ ERROR same body as `if` block
161 185 | | if let Some(a) = Some(42) {}
166 --> $DIR/copies.rs:181:13
170 182 | | if let Some(a) = Some(42) {}
174 error: this `if` has identical blocks
175 --> $DIR/copies.rs:190:12
179 191 | | //~ ERROR same body as `if` block
180 192 | | if let (1, .., 3) = (1, 2, 3) {}
185 --> $DIR/copies.rs:188:13
189 189 | | if let (1, .., 3) = (1, 2, 3) {}
193 error: this `match` has identical arm bodies
194 --> $DIR/copies.rs:239:15
196 239 | 51 => foo(), //~ ERROR match arms have same body
200 --> $DIR/copies.rs:238:15
204 note: consider refactoring into `42 | 51`
205 --> $DIR/copies.rs:238:15
210 error: this `match` has identical arm bodies
211 --> $DIR/copies.rs:245:17
213 245 | None => 24, //~ ERROR match arms have same body
217 --> $DIR/copies.rs:244:20
221 note: consider refactoring into `Some(_) | None`
222 --> $DIR/copies.rs:244:20
227 error: this `match` has identical arm bodies
228 --> $DIR/copies.rs:267:28
230 267 | (None, Some(a)) => bar(a), //~ ERROR match arms have same body
234 --> $DIR/copies.rs:266:28
236 266 | (Some(a), None) => bar(a),
238 note: consider refactoring into `(Some(a), None) | (None, Some(a))`
239 --> $DIR/copies.rs:266:28
241 266 | (Some(a), None) => bar(a),
244 error: this `match` has identical arm bodies
245 --> $DIR/copies.rs:273:26
247 273 | (.., Some(a)) => bar(a), //~ ERROR match arms have same body
251 --> $DIR/copies.rs:272:26
253 272 | (Some(a), ..) => bar(a),
255 note: consider refactoring into `(Some(a), ..) | (.., Some(a))`
256 --> $DIR/copies.rs:272:26
258 272 | (Some(a), ..) => bar(a),
261 error: this `match` has identical arm bodies
262 --> $DIR/copies.rs:279:20
264 279 | (.., 3) => 42, //~ ERROR match arms have same body
268 --> $DIR/copies.rs:278:23
270 278 | (1, .., 3) => 42,
272 note: consider refactoring into `(1, .., 3) | (.., 3)`
273 --> $DIR/copies.rs:278:23
275 278 | (1, .., 3) => 42,
278 error: this `if` has identical blocks
279 --> $DIR/copies.rs:285:12
283 286 | | //~ ERROR same body as `if` block
289 --> $DIR/copies.rs:283:21
291 283 | let _ = if true {
292 | _____________________^
297 error: this `if` has identical blocks
298 --> $DIR/copies.rs:292:12
302 293 | | //~ ERROR same body as `if` block
308 --> $DIR/copies.rs:290:21
310 290 | let _ = if true {
311 | _____________________^
316 error: this `if` has identical blocks
317 --> $DIR/copies.rs:305:12
321 306 | | //~ ERROR same body as `if` block
322 307 | | std::f32::NAN
327 --> $DIR/copies.rs:303:21
329 303 | let _ = if true {
330 | _____________________^
331 304 | | std::f32::NAN
335 error: this `if` has identical blocks
336 --> $DIR/copies.rs:323:12
340 324 | | //~ ERROR same body as `if` block
341 325 | | try!(Ok("foo"));
346 --> $DIR/copies.rs:321:13
350 322 | | try!(Ok("foo"));
354 error: this `if` has the same condition as a previous if
355 --> $DIR/copies.rs:347:15
360 = note: `-D clippy::ifs-same-cond` implied by `-D warnings`
362 --> $DIR/copies.rs:346:8
367 error: this `if` has the same condition as a previous if
368 --> $DIR/copies.rs:352:15
370 352 | } else if a == 1 {
374 --> $DIR/copies.rs:351:8
379 error: this `if` has the same condition as a previous if
380 --> $DIR/copies.rs:358:15
382 358 | } else if 2 * a == 1 {
386 --> $DIR/copies.rs:356:8
388 356 | if 2 * a == 1 {
391 error: aborting due to 20 previous errors