rust/tests/ui/needless_if.stderr
2025-02-15 13:38:16 +01:00

78 lines
1.7 KiB
Text

error: this `if` branch is empty
--> tests/ui/needless_if.rs:27:5
|
LL | if (true) {}
| ^^^^^^^^^^^^ help: you can remove it
|
= note: `-D clippy::needless-if` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_if)]`
error: this `if` branch is empty
--> tests/ui/needless_if.rs:30:5
|
LL | if maybe_side_effect() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `maybe_side_effect();`
error: this `if` branch is empty
--> tests/ui/needless_if.rs:36:5
|
LL | / if {
LL | |
LL | | return;
LL | | } {}
| |________^
|
help: you can remove it
|
LL ~ ({
LL +
LL + return;
LL + });
|
error: this `if` branch is empty
--> tests/ui/needless_if.rs:53:5
|
LL | / if {
LL | |
LL | | if let true = true
LL | | && true
... |
LL | | } && true
LL | | {}
| |______^
|
help: you can remove it
|
LL ~ ({
LL +
LL + if let true = true
LL + && true
LL + {
LL + true
LL + } else {
LL + false
LL + }
LL + } && true);
|
error: this `if` branch is empty
--> tests/ui/needless_if.rs:98:5
|
LL | if { maybe_side_effect() } {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `({ maybe_side_effect() });`
error: this `if` branch is empty
--> tests/ui/needless_if.rs:101:5
|
LL | if { maybe_side_effect() } && true {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `({ maybe_side_effect() } && true);`
error: this `if` branch is empty
--> tests/ui/needless_if.rs:106:5
|
LL | if true {}
| ^^^^^^^^^^ help: you can remove it: `true;`
error: aborting due to 7 previous errors