]>
Commit | Line | Data |
---|---|---|
781aab86 | 1 | error: expected expression, found `let` statement |
4b012472 | 2 | --> $DIR/bad-if-let-suggestion.rs:2:8 |
923072b8 FG |
3 | | |
4 | LL | if let x = 1 && i = 2 {} | |
5 | | ^^^^^^^^^ | |
6 | | | |
7 | = note: only supported directly in conditions of `if` and `while` expressions | |
4b012472 FG |
8 | help: you might have meant to continue the let-chain |
9 | | | |
10 | LL | if let x = 1 && let i = 2 {} | |
11 | | +++ | |
12 | help: you might have meant to compare for equality | |
13 | | | |
14 | LL | if let x = 1 && i == 2 {} | |
15 | | + | |
923072b8 FG |
16 | |
17 | error[E0425]: cannot find value `i` in this scope | |
4b012472 | 18 | --> $DIR/bad-if-let-suggestion.rs:2:21 |
923072b8 FG |
19 | | |
20 | LL | if let x = 1 && i = 2 {} | |
21 | | ^ not found in this scope | |
22 | ||
23 | error[E0425]: cannot find value `i` in this scope | |
4b012472 | 24 | --> $DIR/bad-if-let-suggestion.rs:9:9 |
923072b8 FG |
25 | | |
26 | LL | fn a() { | |
27 | | ------ similarly named function `a` defined here | |
28 | ... | |
29 | LL | if (i + j) = i {} | |
30 | | ^ help: a function with a similar name exists: `a` | |
31 | ||
32 | error[E0425]: cannot find value `j` in this scope | |
4b012472 | 33 | --> $DIR/bad-if-let-suggestion.rs:9:13 |
923072b8 FG |
34 | | |
35 | LL | fn a() { | |
36 | | ------ similarly named function `a` defined here | |
37 | ... | |
38 | LL | if (i + j) = i {} | |
39 | | ^ help: a function with a similar name exists: `a` | |
40 | ||
41 | error[E0425]: cannot find value `i` in this scope | |
4b012472 | 42 | --> $DIR/bad-if-let-suggestion.rs:9:18 |
923072b8 FG |
43 | | |
44 | LL | fn a() { | |
45 | | ------ similarly named function `a` defined here | |
46 | ... | |
47 | LL | if (i + j) = i {} | |
48 | | ^ help: a function with a similar name exists: `a` | |
49 | ||
50 | error[E0425]: cannot find value `x` in this scope | |
4b012472 | 51 | --> $DIR/bad-if-let-suggestion.rs:16:8 |
923072b8 FG |
52 | | |
53 | LL | fn a() { | |
54 | | ------ similarly named function `a` defined here | |
55 | ... | |
56 | LL | if x[0] = 1 {} | |
57 | | ^ help: a function with a similar name exists: `a` | |
58 | ||
923072b8 | 59 | error[E0308]: mismatched types |
4b012472 | 60 | --> $DIR/bad-if-let-suggestion.rs:2:8 |
923072b8 FG |
61 | | |
62 | LL | if let x = 1 && i = 2 {} | |
63 | | ^^^^^^^^^^^^^^^^^^ expected `bool`, found `()` | |
2b03887a FG |
64 | | |
65 | help: you might have meant to compare for equality | |
66 | | | |
67 | LL | if let x = 1 && i == 2 {} | |
68 | | + | |
923072b8 | 69 | |
781aab86 | 70 | error: aborting due to 7 previous errors |
923072b8 | 71 | |
781aab86 | 72 | Some errors have detailed explanations: E0308, E0425. |
923072b8 | 73 | For more information about an error, try `rustc --explain E0308`. |