rust-clippy/tests/ui/needless_if.stderr

66 lines
1.5 KiB
Text
Raw Normal View History

error: this `if` branch is empty
--> $DIR/needless_if.rs:27:5
2023-06-10 11:43:30 +00:00
|
LL | if (true) {}
| ^^^^^^^^^^^^ help: you can remove it
2023-06-10 11:43:30 +00:00
|
= note: `-D clippy::needless-if` implied by `-D warnings`
error: this `if` branch is empty
--> $DIR/needless_if.rs:29:5
|
LL | if maybe_side_effect() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `maybe_side_effect();`
error: this `if` branch is empty
--> $DIR/needless_if.rs:34:5
2023-06-10 11:43:30 +00:00
|
LL | / if {
LL | | return;
LL | | } {}
| |________^
|
help: you can remove it
|
LL ~ ({
2023-06-10 11:43:30 +00:00
LL + return;
LL + });
|
error: this `if` branch is empty
--> $DIR/needless_if.rs:46:5
|
LL | / if {
LL | | if let true = true && true { true } else { false }
LL | | } && true
LL | | {}
| |______^
|
help: you can remove it
|
LL ~ ({
LL + if let true = true && true { true } else { false }
LL + } && true);
|
error: this `if` branch is empty
--> $DIR/needless_if.rs:84:5
|
LL | if { maybe_side_effect() } {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `({ maybe_side_effect() });`
error: this `if` branch is empty
--> $DIR/needless_if.rs:86:5
|
LL | if { maybe_side_effect() } && true {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `({ maybe_side_effect() } && true);`
error: this `if` branch is empty
--> $DIR/needless_if.rs:90:5
2023-06-10 11:43:30 +00:00
|
LL | if true {}
| ^^^^^^^^^^ help: you can remove it: `true;`
2023-06-10 11:43:30 +00:00
error: aborting due to 7 previous errors
2023-06-10 11:43:30 +00:00