mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-21 10:33:27 +00:00
85 lines
2.2 KiB
Text
85 lines
2.2 KiB
Text
error: this `if` can be part of the inner `if_chain!`
|
|
--> $DIR/if_chain_style.rs:14:5
|
|
|
|
|
LL | / if true {
|
|
LL | | let x = "";
|
|
LL | | // `if_chain!` inside `if`
|
|
LL | | if_chain! {
|
|
... |
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: this `let` statement can also be in the `if_chain!`
|
|
--> $DIR/if_chain_style.rs:15:9
|
|
|
|
|
LL | let x = "";
|
|
| ^^^^^^^^^^^
|
|
= note: `-D clippy::if-chain-style` implied by `-D warnings`
|
|
|
|
error: `if a && b;` should be `if a; if b;`
|
|
--> $DIR/if_chain_style.rs:24:12
|
|
|
|
|
LL | if true
|
|
| ____________^
|
|
LL | | // multi-line AND'ed conditions
|
|
LL | | && false;
|
|
| |____________________^
|
|
|
|
error: `let` expression should be inside `then { .. }`
|
|
--> $DIR/if_chain_style.rs:29:9
|
|
|
|
|
LL | let x = "";
|
|
| ^^^^^^^^^^^
|
|
|
|
error: this `if` can be part of the outer `if_chain!`
|
|
--> $DIR/if_chain_style.rs:40:13
|
|
|
|
|
LL | if true {}
|
|
| ^^^^^^^^^^
|
|
|
|
|
help: this `let` statement can also be in the `if_chain!`
|
|
--> $DIR/if_chain_style.rs:38:13
|
|
|
|
|
LL | let x = "";
|
|
| ^^^^^^^^^^^
|
|
|
|
error: `if_chain!` only has one `if`
|
|
--> $DIR/if_chain_style.rs:34:5
|
|
|
|
|
LL | / if_chain! {
|
|
LL | | // single `if` condition
|
|
LL | | if true;
|
|
LL | | then {
|
|
... |
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
= note: this error originates in the macro `__if_chain` which comes from the expansion of the macro `if_chain` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error: `let` expression should be above the `if_chain!`
|
|
--> $DIR/if_chain_style.rs:45:9
|
|
|
|
|
LL | let x = "";
|
|
| ^^^^^^^^^^^
|
|
|
|
error: this `if_chain!` can be merged with the outer `if_chain!`
|
|
--> $DIR/if_chain_style.rs:51:13
|
|
|
|
|
LL | / if_chain! {
|
|
LL | | if true;
|
|
LL | | if true;
|
|
LL | | then {}
|
|
LL | | }
|
|
| |_____________^
|
|
|
|
|
help: these `let` statements can also be in the `if_chain!`
|
|
--> $DIR/if_chain_style.rs:48:13
|
|
|
|
|
LL | / let x = "";
|
|
LL | | let x = "";
|
|
| |_______________________^
|
|
|
|
error: aborting due to 7 previous errors
|
|
|