2019-02-10 03:19:24 -06:00
|
|
|
error: this `if` has identical blocks
|
2022-06-30 03:50:09 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:23:13
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
2021-04-08 10:50:13 -05:00
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | |
|
2019-02-10 03:19:24 -06:00
|
|
|
LL | | Foo { bar: 42 };
|
|
|
|
LL | | 0..10;
|
|
|
|
... |
|
|
|
|
LL | | foo();
|
2021-04-08 10:50:13 -05:00
|
|
|
LL | | } else {
|
2019-02-10 03:19:24 -06:00
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
note: same as this
|
2023-07-02 07:35:19 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:32:12
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
2021-04-08 10:50:13 -05:00
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
2019-02-10 03:19:24 -06:00
|
|
|
LL | | Foo { bar: 42 };
|
|
|
|
LL | | 0..10;
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | | ..;
|
2019-02-10 03:19:24 -06:00
|
|
|
... |
|
|
|
|
LL | | foo();
|
2021-04-08 10:50:13 -05:00
|
|
|
LL | | }
|
2019-02-10 03:19:24 -06:00
|
|
|
| |_____^
|
2022-09-22 11:04:22 -05:00
|
|
|
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::if_same_then_else)]`
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2022-06-30 03:50:09 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:67:21
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
|
|
|
LL | let _ = if true {
|
|
|
|
| _____________________^
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | |
|
2019-02-10 03:19:24 -06:00
|
|
|
LL | | 0.0
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
|
note: same as this
|
2023-07-02 07:35:19 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:70:12
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
2021-04-08 10:50:13 -05:00
|
|
|
LL | | 0.0
|
2019-02-10 03:19:24 -06:00
|
|
|
LL | | };
|
|
|
|
| |_____^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2022-06-30 03:50:09 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:74:21
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
|
|
|
LL | let _ = if true {
|
|
|
|
| _____________________^
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | |
|
2019-02-10 03:19:24 -06:00
|
|
|
LL | | -0.0
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
|
note: same as this
|
2023-07-02 07:35:19 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:77:12
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
2021-04-08 10:50:13 -05:00
|
|
|
LL | | -0.0
|
2019-02-10 03:19:24 -06:00
|
|
|
LL | | };
|
|
|
|
| |_____^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2022-06-30 03:50:09 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:90:21
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
|
|
|
LL | let _ = if true {
|
|
|
|
| _____________________^
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | |
|
2019-02-10 03:19:24 -06:00
|
|
|
LL | | 42
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
|
note: same as this
|
2023-07-02 07:35:19 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:93:12
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
2021-04-08 10:50:13 -05:00
|
|
|
LL | | 42
|
|
|
|
LL | | };
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2022-06-30 03:50:09 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:97:13
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | |
|
2019-02-10 03:19:24 -06:00
|
|
|
LL | | let bar = if true { 42 } else { 43 };
|
|
|
|
LL | |
|
|
|
|
... |
|
|
|
|
LL | | bar + 1;
|
2021-04-08 10:50:13 -05:00
|
|
|
LL | | } else {
|
2019-02-10 03:19:24 -06:00
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
note: same as this
|
2023-07-02 07:35:19 -05:00
|
|
|
--> $DIR/if_same_then_else.rs:105:12
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
2021-04-08 10:50:13 -05:00
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
2019-02-10 03:19:24 -06:00
|
|
|
LL | | let bar = if true { 42 } else { 43 };
|
|
|
|
LL | |
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | | while foo() {
|
2019-02-10 03:19:24 -06:00
|
|
|
... |
|
|
|
|
LL | | bar + 1;
|
2021-04-08 10:50:13 -05:00
|
|
|
LL | | }
|
2019-02-10 03:19:24 -06:00
|
|
|
| |_____^
|
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
error: this `if` has identical blocks
|
|
|
|
--> $DIR/if_same_then_else.rs:250:14
|
|
|
|
|
|
|
|
|
LL | if x {
|
|
|
|
| ______________^
|
|
|
|
LL | | 0_u8.is_power_of_two()
|
|
|
|
LL | | } else {
|
|
|
|
| |_________^
|
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/if_same_then_else.rs:252:16
|
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ________________^
|
|
|
|
LL | | 0_u8.is_power_of_two()
|
|
|
|
LL | | }
|
|
|
|
| |_________^
|
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
2019-02-10 03:19:24 -06:00
|
|
|
|