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