fork/rust

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

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

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