e324a59eb6
- Add doc comment to new type - Restore "only supported directly in conditions of `if` and `while` expressions" note - Rename variant with clearer name
66 lines
1.9 KiB
Plaintext
66 lines
1.9 KiB
Plaintext
error: expected expression, found `let` statement
|
|
--> $DIR/bad-if-let-suggestion.rs:5:8
|
|
|
|
|
LL | if let x = 1 && i = 2 {}
|
|
| ^^^^^^^^^
|
|
|
|
|
= note: only supported directly in conditions of `if` and `while` expressions
|
|
|
|
error[E0425]: cannot find value `i` in this scope
|
|
--> $DIR/bad-if-let-suggestion.rs:5: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:12: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:12: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:12: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:19: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:5: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`.
|