2019-02-10 09:19:24 +00:00
|
|
|
error: this `if` has identical blocks
|
2022-06-30 08:50:09 +00:00
|
|
|
--> $DIR/if_same_then_else.rs:23:13
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
2023-07-02 12:35:19 +00:00
|
|
|
LL | |
|
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 | | } else {
|
2019-02-10 09:19:24 +00:00
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
note: same as this
|
2023-07-02 12:35:19 +00:00
|
|
|
--> $DIR/if_same_then_else.rs:32:12
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
2019-02-10 09:19:24 +00:00
|
|
|
LL | | Foo { bar: 42 };
|
|
|
|
LL | | 0..10;
|
2023-07-02 12:35:19 +00:00
|
|
|
LL | | ..;
|
2019-02-10 09:19:24 +00:00
|
|
|
... |
|
|
|
|
LL | | foo();
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | | }
|
2019-02-10 09:19:24 +00:00
|
|
|
| |_____^
|
2022-09-22 16:04:22 +00:00
|
|
|
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::if_same_then_else)]`
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2022-06-30 08:50:09 +00:00
|
|
|
--> $DIR/if_same_then_else.rs:67:21
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
|
|
|
LL | let _ = if true {
|
|
|
|
| _____________________^
|
2023-07-02 12:35:19 +00:00
|
|
|
LL | |
|
2019-02-10 09:19:24 +00:00
|
|
|
LL | | 0.0
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
note: same as this
|
2023-07-02 12:35:19 +00:00
|
|
|
--> $DIR/if_same_then_else.rs:70:12
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
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
|
2022-06-30 08:50:09 +00:00
|
|
|
--> $DIR/if_same_then_else.rs:74:21
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
|
|
|
LL | let _ = if true {
|
|
|
|
| _____________________^
|
2023-07-02 12:35:19 +00:00
|
|
|
LL | |
|
2019-02-10 09:19:24 +00:00
|
|
|
LL | | -0.0
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
note: same as this
|
2023-07-02 12:35:19 +00:00
|
|
|
--> $DIR/if_same_then_else.rs:77:12
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
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
|
2022-06-30 08:50:09 +00:00
|
|
|
--> $DIR/if_same_then_else.rs:90:21
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
|
|
|
LL | let _ = if true {
|
|
|
|
| _____________________^
|
2023-07-02 12:35:19 +00:00
|
|
|
LL | |
|
2019-02-10 09:19:24 +00:00
|
|
|
LL | | 42
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
note: same as this
|
2023-07-02 12:35:19 +00:00
|
|
|
--> $DIR/if_same_then_else.rs:93:12
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | | 42
|
|
|
|
LL | | };
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2022-06-30 08:50:09 +00:00
|
|
|
--> $DIR/if_same_then_else.rs:97:13
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
2023-07-02 12:35:19 +00:00
|
|
|
LL | |
|
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 | | } else {
|
2019-02-10 09:19:24 +00:00
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
note: same as this
|
2023-07-02 12:35:19 +00:00
|
|
|
--> $DIR/if_same_then_else.rs:105:12
|
2019-02-10 09:19:24 +00:00
|
|
|
|
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
2019-02-10 09:19:24 +00:00
|
|
|
LL | | let bar = if true { 42 } else { 43 };
|
|
|
|
LL | |
|
2023-07-02 12:35:19 +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 | | }
|
2019-02-10 09:19:24 +00:00
|
|
|
| |_____^
|
|
|
|
|
2023-07-31 21:53:53 +00: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 09:19:24 +00:00
|
|
|
|