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 {
|
|
|
|
| _____________^
|
2019-02-10 03:19:24 -06:00
|
|
|
LL | | Foo { bar: 42 };
|
|
|
|
LL | | 0..10;
|
2024-01-25 12:17:36 -06:00
|
|
|
LL | | ..;
|
2019-02-10 03:19:24 -06:00
|
|
|
... |
|
|
|
|
LL | | foo();
|
2021-04-08 10:50:13 -05:00
|
|
|
LL | | } else {
|
2019-02-10 03:19:24 -06:00
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
note: same as this
|
2024-01-25 12:17:36 -06:00
|
|
|
--> $DIR/if_same_then_else.rs:31: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
|
|
|
|
|
2024-01-25 12:17:36 -06:00
|
|
|
LL | let _ = if true { 0.0 } else { 0.0 };
|
|
|
|
| ^^^^^^^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
|
note: same as this
|
2024-01-25 12:17:36 -06:00
|
|
|
--> $DIR/if_same_then_else.rs:67:34
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
2024-01-25 12:17:36 -06:00
|
|
|
LL | let _ = if true { 0.0 } else { 0.0 };
|
|
|
|
| ^^^^^^^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2024-01-25 12:17:36 -06:00
|
|
|
--> $DIR/if_same_then_else.rs:70:21
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
2024-01-25 12:17:36 -06:00
|
|
|
LL | let _ = if true { -0.0 } else { -0.0 };
|
|
|
|
| ^^^^^^^^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
|
note: same as this
|
2024-01-25 12:17:36 -06:00
|
|
|
--> $DIR/if_same_then_else.rs:70:35
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
2024-01-25 12:17:36 -06:00
|
|
|
LL | let _ = if true { -0.0 } else { -0.0 };
|
|
|
|
| ^^^^^^^^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2024-01-25 12:17:36 -06:00
|
|
|
--> $DIR/if_same_then_else.rs:82:21
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
2024-01-25 12:17:36 -06:00
|
|
|
LL | let _ = if true { 42 } else { 42 };
|
|
|
|
| ^^^^^^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
|
note: same as this
|
2024-01-25 12:17:36 -06:00
|
|
|
--> $DIR/if_same_then_else.rs:82:33
|
2019-02-10 03:19:24 -06:00
|
|
|
|
|
2024-01-25 12:17:36 -06:00
|
|
|
LL | let _ = if true { 42 } else { 42 };
|
|
|
|
| ^^^^^^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2024-01-25 12:17:36 -06:00
|
|
|
--> $DIR/if_same_then_else.rs:85:13
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
2019-02-10 03:19:24 -06:00
|
|
|
LL | | let bar = if true { 42 } else { 43 };
|
|
|
|
LL | |
|
2024-01-25 12:17:36 -06:00
|
|
|
LL | | while foo() {
|
2019-02-10 03:19:24 -06:00
|
|
|
... |
|
|
|
|
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
|
2024-01-25 12:17:36 -06:00
|
|
|
--> $DIR/if_same_then_else.rs:92: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
|
2024-01-25 12:17:36 -06:00
|
|
|
--> $DIR/if_same_then_else.rs:238:14
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | if x {
|
|
|
|
| ______________^
|
|
|
|
LL | | 0_u8.is_power_of_two()
|
|
|
|
LL | | } else {
|
|
|
|
| |_________^
|
|
|
|
|
|
|
|
|
note: same as this
|
2024-01-25 12:17:36 -06:00
|
|
|
--> $DIR/if_same_then_else.rs:240:16
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
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
|
|
|
|