2021-04-08 15:50:13 +00:00
error: this `if` can be part of the inner `if_chain!`
2023-07-02 12:35:19 +00:00
--> $DIR/if_chain_style.rs:14:5
2021-04-08 15:50:13 +00:00
|
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!`
2023-07-02 12:35:19 +00:00
--> $DIR/if_chain_style.rs:15:9
2021-04-08 15:50:13 +00:00
|
LL | let x = "";
| ^^^^^^^^^^^
2022-10-06 07:44:38 +00:00
= note: `-D clippy::if-chain-style` implied by `-D warnings`
2021-04-08 15:50:13 +00:00
error: `if a && b;` should be `if a; if b;`
2023-07-02 12:35:19 +00:00
--> $DIR/if_chain_style.rs:24:12
2021-04-08 15:50:13 +00:00
|
LL | if true
| ____________^
LL | | // multi-line AND'ed conditions
LL | | && false;
| |____________________^
error: `let` expression should be inside `then { .. }`
2023-07-02 12:35:19 +00:00
--> $DIR/if_chain_style.rs:29:9
2021-04-08 15:50:13 +00:00
|
LL | let x = "";
| ^^^^^^^^^^^
error: this `if` can be part of the outer `if_chain!`
2023-07-02 12:35:19 +00:00
--> $DIR/if_chain_style.rs:40:13
2021-04-08 15:50:13 +00:00
|
LL | if true {}
| ^^^^^^^^^^
|
help: this `let` statement can also be in the `if_chain!`
2023-07-02 12:35:19 +00:00
--> $DIR/if_chain_style.rs:38:13
2021-04-08 15:50:13 +00:00
|
LL | let x = "";
| ^^^^^^^^^^^
error: `if_chain!` only has one `if`
2023-07-02 12:35:19 +00:00
--> $DIR/if_chain_style.rs:34:5
2021-04-08 15:50:13 +00:00
|
LL | / if_chain! {
LL | | // single `if` condition
LL | | if true;
LL | | then {
... |
LL | | }
LL | | }
| |_____^
|
2022-07-28 17:08:22 +00:00
= 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)
2021-04-08 15:50:13 +00:00
error: `let` expression should be above the `if_chain!`
2023-07-02 12:35:19 +00:00
--> $DIR/if_chain_style.rs:45:9
2021-04-08 15:50:13 +00:00
|
LL | let x = "";
| ^^^^^^^^^^^
error: this `if_chain!` can be merged with the outer `if_chain!`
2023-07-02 12:35:19 +00:00
--> $DIR/if_chain_style.rs:51:13
2021-04-08 15:50:13 +00:00
|
LL | / if_chain! {
LL | | if true;
LL | | if true;
LL | | then {}
LL | | }
| |_____________^
|
help: these `let` statements can also be in the `if_chain!`
2023-07-02 12:35:19 +00:00
--> $DIR/if_chain_style.rs:48:13
2021-04-08 15:50:13 +00:00
|
LL | / let x = "";
LL | | let x = "";
| |_______________________^
error: aborting due to 7 previous errors