2018-02-08 19:26:50 +00:00
|
|
|
error: this `if` has identical blocks
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:41:12
|
2018-02-08 19:26:50 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | } else {
|
2018-12-10 05:27:19 +00:00
|
|
|
| ____________^
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | | //~ ERROR same body as `if` block
|
|
|
|
LL | | Foo { bar: 42 };
|
|
|
|
LL | | 0..10;
|
2018-02-08 19:26:50 +00:00
|
|
|
... |
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | | foo();
|
|
|
|
LL | | }
|
2018-02-08 19:26:50 +00:00
|
|
|
| |_____^
|
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
|
2018-02-08 19:26:50 +00:00
|
|
|
note: same as this
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:33:13
|
2018-02-08 19:26:50 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if true {
|
2018-02-08 19:26:50 +00:00
|
|
|
| _____________^
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | | Foo { bar: 42 };
|
|
|
|
LL | | 0..10;
|
|
|
|
LL | | ..;
|
2018-02-08 19:26:50 +00:00
|
|
|
... |
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | | foo();
|
|
|
|
LL | | } else {
|
2018-02-08 19:26:50 +00:00
|
|
|
| |_____^
|
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:87:14
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | _ => {
|
|
|
|
| ______________^
|
|
|
|
LL | | //~ ERROR match arms have same body
|
|
|
|
LL | | foo();
|
|
|
|
LL | | let mut a = 42 + [23].len() as i32;
|
|
|
|
... |
|
|
|
|
LL | | a
|
|
|
|
LL | | },
|
|
|
|
| |_________^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::match-same-arms` implied by `-D warnings`
|
2018-02-08 19:26:50 +00:00
|
|
|
note: same as this
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:78:15
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | 42 => {
|
|
|
|
| _______________^
|
|
|
|
LL | | foo();
|
|
|
|
LL | | let mut a = 42 + [23].len() as i32;
|
|
|
|
LL | | if true {
|
|
|
|
... |
|
|
|
|
LL | | a
|
|
|
|
LL | | },
|
|
|
|
| |_________^
|
2018-02-08 19:26:50 +00:00
|
|
|
note: `42` has the same arm body as the `_` wildcard, consider removing it`
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:78:15
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | 42 => {
|
|
|
|
| _______________^
|
|
|
|
LL | | foo();
|
|
|
|
LL | | let mut a = 42 + [23].len() as i32;
|
|
|
|
LL | | if true {
|
|
|
|
... |
|
|
|
|
LL | | a
|
|
|
|
LL | | },
|
|
|
|
| |_________^
|
2018-02-08 19:26:50 +00:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:102:14
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | _ => 0, //~ ERROR match arms have same body
|
|
|
|
| ^
|
|
|
|
|
|
2018-02-08 19:26:50 +00:00
|
|
|
note: same as this
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:100:19
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | Abc::A => 0,
|
|
|
|
| ^
|
2018-02-08 19:26:50 +00:00
|
|
|
note: `Abc::A` has the same arm body as the `_` wildcard, consider removing it`
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:100:19
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | Abc::A => 0,
|
|
|
|
| ^
|
2018-02-08 19:26:50 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:111:12
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
|
|
|
LL | | 42
|
|
|
|
LL | | };
|
|
|
|
| |_____^
|
|
|
|
|
|
2018-02-08 19:26:50 +00:00
|
|
|
note: same as this
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:109:21
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | let _ = if true {
|
|
|
|
| _____________________^
|
|
|
|
LL | | 42
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2018-02-08 19:26:50 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:125:12
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
|
|
|
LL | | for _ in &[42] {
|
|
|
|
LL | | let foo: &Option<_> = &Some::<u8>(42);
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2018-02-08 19:26:50 +00:00
|
|
|
note: same as this
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:116:13
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
|
|
|
LL | | for _ in &[42] {
|
|
|
|
LL | | let foo: &Option<_> = &Some::<u8>(42);
|
|
|
|
LL | | if true {
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2018-02-08 19:26:50 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:144:12
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
|
|
|
LL | | let bar = if true { 42 } else { 43 };
|
|
|
|
LL | |
|
|
|
|
... |
|
|
|
|
LL | | bar + 1;
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2018-02-08 19:26:50 +00:00
|
|
|
note: same as this
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:137:13
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
|
|
|
LL | | let bar = if true { 42 } else { 43 };
|
|
|
|
LL | |
|
|
|
|
LL | | while foo() {
|
|
|
|
... |
|
|
|
|
LL | | bar + 1;
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2018-02-08 19:26:50 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:174:12
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
|
|
|
LL | | if let Some(a) = Some(42) {}
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2018-02-08 19:26:50 +00:00
|
|
|
note: same as this
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:172:13
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
|
|
|
LL | | if let Some(a) = Some(42) {}
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2018-02-08 19:26:50 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:181:12
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
|
|
|
LL | | if let (1, .., 3) = (1, 2, 3) {}
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2018-02-08 19:26:50 +00:00
|
|
|
note: same as this
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:179:13
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
|
|
|
LL | | if let (1, .., 3) = (1, 2, 3) {}
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2018-02-08 19:26:50 +00:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:230:15
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | 51 => foo(), //~ ERROR match arms have same body
|
|
|
|
| ^^^^^
|
|
|
|
|
|
2018-02-08 19:26:50 +00:00
|
|
|
note: same as this
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:229:15
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | 42 => foo(),
|
|
|
|
| ^^^^^
|
2018-02-08 19:26:50 +00:00
|
|
|
note: consider refactoring into `42 | 51`
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:229:15
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | 42 => foo(),
|
|
|
|
| ^^^^^
|
2018-02-08 19:26:50 +00:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:236:17
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | None => 24, //~ ERROR match arms have same body
|
|
|
|
| ^^
|
|
|
|
|
|
2018-02-08 19:26:50 +00:00
|
|
|
note: same as this
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:235:20
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | Some(_) => 24,
|
|
|
|
| ^^
|
2018-02-08 19:26:50 +00:00
|
|
|
note: consider refactoring into `Some(_) | None`
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:235:20
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | Some(_) => 24,
|
|
|
|
| ^^
|
2018-02-08 19:26:50 +00:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:258:28
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | (None, Some(a)) => bar(a), //~ ERROR match arms have same body
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
2018-02-08 19:26:50 +00:00
|
|
|
note: same as this
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:257:28
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | (Some(a), None) => bar(a),
|
|
|
|
| ^^^^^^
|
2018-02-08 19:26:50 +00:00
|
|
|
note: consider refactoring into `(Some(a), None) | (None, Some(a))`
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:257:28
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | (Some(a), None) => bar(a),
|
|
|
|
| ^^^^^^
|
2018-02-08 19:26:50 +00:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:264:26
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | (.., Some(a)) => bar(a), //~ ERROR match arms have same body
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
2018-02-08 19:26:50 +00:00
|
|
|
note: same as this
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:263:26
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | (Some(a), ..) => bar(a),
|
|
|
|
| ^^^^^^
|
2018-02-08 19:26:50 +00:00
|
|
|
note: consider refactoring into `(Some(a), ..) | (.., Some(a))`
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:263:26
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | (Some(a), ..) => bar(a),
|
|
|
|
| ^^^^^^
|
2018-02-08 19:26:50 +00:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:270:20
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | (.., 3) => 42, //~ ERROR match arms have same body
|
|
|
|
| ^^
|
|
|
|
|
|
2018-02-08 19:26:50 +00:00
|
|
|
note: same as this
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:269:23
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | (1, .., 3) => 42,
|
|
|
|
| ^^
|
2018-02-08 19:26:50 +00:00
|
|
|
note: consider refactoring into `(1, .., 3) | (.., 3)`
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:269:23
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | (1, .., 3) => 42,
|
|
|
|
| ^^
|
2018-02-08 19:26:50 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:276:12
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
|
|
|
LL | | 0.0
|
|
|
|
LL | | };
|
|
|
|
| |_____^
|
|
|
|
|
|
2018-02-08 19:26:50 +00:00
|
|
|
note: same as this
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:274:21
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | let _ = if true {
|
|
|
|
| _____________________^
|
|
|
|
LL | | 0.0
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2018-02-08 19:26:50 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:283:12
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
|
|
|
LL | | -0.0
|
|
|
|
LL | | };
|
|
|
|
| |_____^
|
|
|
|
|
|
2018-02-08 19:26:50 +00:00
|
|
|
note: same as this
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:281:21
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | let _ = if true {
|
|
|
|
| _____________________^
|
|
|
|
LL | | -0.0
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2018-02-08 19:26:50 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:296:12
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
|
|
|
LL | | std::f32::NAN
|
|
|
|
LL | | };
|
|
|
|
| |_____^
|
|
|
|
|
|
2018-02-08 19:26:50 +00:00
|
|
|
note: same as this
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:294:21
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | let _ = if true {
|
|
|
|
| _____________________^
|
|
|
|
LL | | std::f32::NAN
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2018-02-08 19:26:50 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:314:12
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
|
|
|
LL | | try!(Ok("foo"));
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2018-02-08 19:26:50 +00:00
|
|
|
note: same as this
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/copies.rs:312:13
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
|
|
|
LL | | try!(Ok("foo"));
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2018-02-08 19:26:50 +00:00
|
|
|
|
2019-01-02 06:59:48 +00:00
|
|
|
error: aborting due to 17 previous errors
|
2018-01-16 16:06:27 +00:00
|
|
|
|