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