rust/tests/ui/needless_if.stderr
Philipp Krones 62a82b361c
Format let-chains across the code base
In the updated nightly version, it seems that rustfmt now supports formatting
let-chains. Since we're using them a lot, it's a lot of reformatting.
2023-11-02 17:24:30 +01:00

76 lines
1.7 KiB
Plaintext

error: this `if` branch is empty
--> $DIR/needless_if.rs:26: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
--> $DIR/needless_if.rs:28:5
|
LL | if maybe_side_effect() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `maybe_side_effect();`
error: this `if` branch is empty
--> $DIR/needless_if.rs:33:5
|
LL | / if {
LL | | return;
LL | | } {}
| |________^
|
help: you can remove it
|
LL ~ ({
LL + return;
LL + });
|
error: this `if` branch is empty
--> $DIR/needless_if.rs:49:5
|
LL | / if {
LL | | if let true = true
LL | | && true
LL | | {
... |
LL | | } && true
LL | | {}
| |______^
|
help: you can remove it
|
LL ~ ({
LL + if let true = true
LL + && true
LL + {
LL + true
LL + } else {
LL + false
LL + }
LL + } && true);
|
error: this `if` branch is empty
--> $DIR/needless_if.rs:93:5
|
LL | if { maybe_side_effect() } {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `({ maybe_side_effect() });`
error: this `if` branch is empty
--> $DIR/needless_if.rs:95: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:99:5
|
LL | if true {}
| ^^^^^^^^^^ help: you can remove it: `true;`
error: aborting due to 7 previous errors