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