2023-07-02 07:35:19 -05:00
|
|
|
error: this `if` branch is empty
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/needless_if.rs:27:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | if (true) {}
|
|
|
|
| ^^^^^^^^^^^^ help: you can remove it
|
|
|
|
|
|
|
|
|
= note: `-D clippy::needless-if` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::needless_if)]`
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
error: this `if` branch is empty
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/needless_if.rs:29:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | if maybe_side_effect() {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `maybe_side_effect();`
|
|
|
|
|
|
|
|
error: this `if` branch is empty
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/needless_if.rs:34:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | / if {
|
|
|
|
LL | | return;
|
|
|
|
LL | | } {}
|
|
|
|
| |________^
|
|
|
|
|
|
|
|
|
help: you can remove it
|
|
|
|
|
|
|
|
|
LL ~ ({
|
|
|
|
LL + return;
|
|
|
|
LL + });
|
|
|
|
|
|
|
|
|
|
|
|
|
error: this `if` branch is empty
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/needless_if.rs:50:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | / if {
|
2023-11-02 11:12:25 -05:00
|
|
|
LL | | if let true = true
|
|
|
|
LL | | && true
|
|
|
|
LL | | {
|
|
|
|
... |
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | | } && true
|
|
|
|
LL | | {}
|
|
|
|
| |______^
|
|
|
|
|
|
|
|
|
help: you can remove it
|
|
|
|
|
|
|
|
|
LL ~ ({
|
2023-11-02 11:12:25 -05:00
|
|
|
LL + if let true = true
|
|
|
|
LL + && true
|
|
|
|
LL + {
|
|
|
|
LL + true
|
|
|
|
LL + } else {
|
|
|
|
LL + false
|
|
|
|
LL + }
|
2023-07-02 07:35:19 -05:00
|
|
|
LL + } && true);
|
|
|
|
|
|
|
|
|
|
|
|
|
error: this `if` branch is empty
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/needless_if.rs:94:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | if { maybe_side_effect() } {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `({ maybe_side_effect() });`
|
|
|
|
|
|
|
|
error: this `if` branch is empty
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/needless_if.rs:96:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | if { maybe_side_effect() } && true {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `({ maybe_side_effect() } && true);`
|
|
|
|
|
|
|
|
error: this `if` branch is empty
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/needless_if.rs:100:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | if true {}
|
|
|
|
| ^^^^^^^^^^ help: you can remove it: `true;`
|
|
|
|
|
|
|
|
error: aborting due to 7 previous errors
|
|
|
|
|