2019-02-10 03:19:24 -06:00
|
|
|
error: this `if` has identical blocks
|
2022-06-16 07:29:43 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:23:13
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
2020-12-11 16:29:53 -06:00
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
2019-02-10 03:19:24 -06:00
|
|
|
LL | | Foo { bar: 42 };
|
|
|
|
LL | | 0..10;
|
2020-12-11 16:29:53 -06:00
|
|
|
LL | | ..;
|
2019-02-10 03:19:24 -06:00
|
|
|
... |
|
|
|
|
LL | | foo();
|
2020-12-11 16:29:53 -06:00
|
|
|
LL | | } else {
|
2019-02-10 03:19:24 -06:00
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
|
|
|
|
note: same as this
|
2022-06-16 07:29:43 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:31:12
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
2020-12-11 16:29:53 -06:00
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
2019-02-10 03:19:24 -06:00
|
|
|
LL | | Foo { bar: 42 };
|
|
|
|
LL | | 0..10;
|
|
|
|
... |
|
|
|
|
LL | | foo();
|
2020-12-11 16:29:53 -06:00
|
|
|
LL | | }
|
2019-02-10 03:19:24 -06:00
|
|
|
| |_____^
|
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2022-06-16 07:29:43 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:67:21
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
|
|
|
LL | let _ = if true {
|
|
|
|
| _____________________^
|
|
|
|
LL | | 0.0
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2020-12-11 16:29:53 -06:00
|
|
|
|
|
|
|
|
note: same as this
|
2022-06-16 07:29:43 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:69:12
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
2020-12-11 16:29:53 -06:00
|
|
|
LL | | 0.0
|
2019-02-10 03:19:24 -06:00
|
|
|
LL | | };
|
|
|
|
| |_____^
|
2020-12-11 16:29:53 -06:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2022-06-16 07:29:43 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:74:21
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
|
|
|
LL | let _ = if true {
|
|
|
|
| _____________________^
|
|
|
|
LL | | -0.0
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2020-12-11 16:29:53 -06:00
|
|
|
|
|
|
|
|
note: same as this
|
2022-06-16 07:29:43 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:76:12
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
2020-12-11 16:29:53 -06:00
|
|
|
LL | | -0.0
|
2019-02-10 03:19:24 -06:00
|
|
|
LL | | };
|
|
|
|
| |_____^
|
2020-12-11 16:29:53 -06:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2022-06-16 07:29:43 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:90:21
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
|
|
|
LL | let _ = if true {
|
|
|
|
| _____________________^
|
|
|
|
LL | | 42
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2020-12-11 16:29:53 -06:00
|
|
|
|
|
|
|
|
note: same as this
|
2022-06-16 07:29:43 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:92:12
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
2020-12-11 16:29:53 -06:00
|
|
|
LL | | 42
|
|
|
|
LL | | };
|
|
|
|
| |_____^
|
|
|
|
|
2021-02-25 16:33:46 -06:00
|
|
|
error: this `if` has identical blocks
|
2022-06-16 07:29:43 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:97:13
|
2021-02-25 16:33:46 -06:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
|
|
|
LL | | let bar = if true { 42 } else { 43 };
|
|
|
|
LL | |
|
|
|
|
LL | | while foo() {
|
|
|
|
... |
|
|
|
|
LL | | bar + 1;
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
note: same as this
|
2022-06-16 07:29:43 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:104:12
|
2021-02-25 16:33:46 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
|
|
|
LL | | let bar = if true { 42 } else { 43 };
|
|
|
|
LL | |
|
|
|
|
... |
|
|
|
|
LL | | bar + 1;
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
error: aborting due to 5 previous errors
|
2019-02-10 03:19:24 -06:00
|
|
|
|