fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.3 KiB86 linesraw
1error: this `if` can be part of the inner `if_chain!`
2  --> $DIR/if_chain_style.rs:14:5
3   |
4LL | /     if true {
5LL | |         let x = "";
6LL | |         // `if_chain!` inside `if`
7LL | |         if_chain! {
8...  |
9LL | |         }
10LL | |     }
11   | |_____^
12   |
13help: this `let` statement can also be in the `if_chain!`
14  --> $DIR/if_chain_style.rs:15:9
15   |
16LL |         let x = "";
17   |         ^^^^^^^^^^^
18   = note: `-D clippy::if-chain-style` implied by `-D warnings`
19   = help: to override `-D warnings` add `#[allow(clippy::if_chain_style)]`
20
21error: `if a && b;` should be `if a; if b;`
22  --> $DIR/if_chain_style.rs:24:12
23   |
24LL |           if true
25   |  ____________^
26LL | |             // multi-line AND'ed conditions
27LL | |             && false;
28   | |____________________^
29
30error: `let` expression should be inside `then { .. }`
31  --> $DIR/if_chain_style.rs:29:9
32   |
33LL |         let x = "";
34   |         ^^^^^^^^^^^
35
36error: this `if` can be part of the outer `if_chain!`
37  --> $DIR/if_chain_style.rs:40:13
38   |
39LL |             if true {}
40   |             ^^^^^^^^^^
41   |
42help: this `let` statement can also be in the `if_chain!`
43  --> $DIR/if_chain_style.rs:38:13
44   |
45LL |             let x = "";
46   |             ^^^^^^^^^^^
47
48error: `if_chain!` only has one `if`
49  --> $DIR/if_chain_style.rs:34:5
50   |
51LL | /     if_chain! {
52LL | |         // single `if` condition
53LL | |         if true;
54LL | |         then {
55...  |
56LL | |         }
57LL | |     }
58   | |_____^
59   |
60   = 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)
61
62error: `let` expression should be above the `if_chain!`
63  --> $DIR/if_chain_style.rs:45:9
64   |
65LL |         let x = "";
66   |         ^^^^^^^^^^^
67
68error: this `if_chain!` can be merged with the outer `if_chain!`
69  --> $DIR/if_chain_style.rs:51:13
70   |
71LL | /             if_chain! {
72LL | |                 if true;
73LL | |                 if true;
74LL | |                 then {}
75LL | |             }
76   | |_____________^
77   |
78help: these `let` statements can also be in the `if_chain!`
79  --> $DIR/if_chain_style.rs:48:13
80   |
81LL | /             let x = "";
82LL | |             let x = "";
83   | |_______________________^
84
85error: aborting due to 7 previous errors
86