2019-02-10 09:19:24 +00:00
|
|
|
error: this `if` has identical blocks
|
2021-04-08 15:50:13 +00:00
|
|
|
--> $DIR/if_same_then_else.rs:21:13
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
2019-02-10 09:19:24 +00:00
|
|
|
LL | | Foo { bar: 42 };
|
|
|
|
LL | | 0..10;
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | | ..;
|
2019-02-10 09:19:24 +00:00
|
|
|
... |
|
|
|
|
LL | | foo();
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | | } else {
|
2019-02-10 09:19:24 +00:00
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
|
|
|
|
note: same as this
|
2021-04-08 15:50:13 +00:00
|
|
|
--> $DIR/if_same_then_else.rs:29:12
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
2019-02-10 09:19:24 +00:00
|
|
|
LL | | Foo { bar: 42 };
|
|
|
|
LL | | 0..10;
|
|
|
|
... |
|
|
|
|
LL | | foo();
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | | }
|
2019-02-10 09:19:24 +00:00
|
|
|
| |_____^
|
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2021-04-08 15:50:13 +00:00
|
|
|
--> $DIR/if_same_then_else.rs:65:21
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
|
|
|
LL | let _ = if true {
|
|
|
|
| _____________________^
|
|
|
|
LL | | 0.0
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/if_same_then_else.rs:67:12
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | | 0.0
|
2019-02-10 09:19:24 +00:00
|
|
|
LL | | };
|
|
|
|
| |_____^
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
|
|
|
--> $DIR/if_same_then_else.rs:72:21
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
|
|
|
LL | let _ = if true {
|
|
|
|
| _____________________^
|
|
|
|
LL | | -0.0
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/if_same_then_else.rs:74:12
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | | -0.0
|
2019-02-10 09:19:24 +00:00
|
|
|
LL | | };
|
|
|
|
| |_____^
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
|
|
|
--> $DIR/if_same_then_else.rs:88:21
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
|
|
|
LL | let _ = if true {
|
|
|
|
| _____________________^
|
|
|
|
LL | | 42
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/if_same_then_else.rs:90:12
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | | 42
|
|
|
|
LL | | };
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
|
|
|
--> $DIR/if_same_then_else.rs:95:13
|
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
2019-02-10 09:19:24 +00:00
|
|
|
LL | | let bar = if true { 42 } else { 43 };
|
|
|
|
LL | |
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | | while foo() {
|
2019-02-10 09:19:24 +00:00
|
|
|
... |
|
|
|
|
LL | | bar + 1;
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | | } else {
|
2019-02-10 09:19:24 +00:00
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
note: same as this
|
2021-04-08 15:50:13 +00:00
|
|
|
--> $DIR/if_same_then_else.rs:102:12
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
2019-02-10 09:19:24 +00:00
|
|
|
LL | | let bar = if true { 42 } else { 43 };
|
|
|
|
LL | |
|
|
|
|
... |
|
|
|
|
LL | | bar + 1;
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | | }
|
2019-02-10 09:19:24 +00:00
|
|
|
| |_____^
|
|
|
|
|
2020-01-19 06:04:41 +00:00
|
|
|
error: aborting due to 5 previous errors
|
2019-02-10 09:19:24 +00:00
|
|
|
|