]> git.proxmox.com Git - rustc.git/blob - src/test/ui/expr/if/bad-if-let-suggestion.stderr
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / expr / if / bad-if-let-suggestion.stderr
1 error: `let` expressions are not supported here
2 --> $DIR/bad-if-let-suggestion.rs:5:8
3 |
4 LL | if let x = 1 && i = 2 {}
5 | ^^^^^^^^^
6 |
7 = note: only supported directly in conditions of `if` and `while` expressions
8
9 error[E0425]: cannot find value `i` in this scope
10 --> $DIR/bad-if-let-suggestion.rs:5:21
11 |
12 LL | if let x = 1 && i = 2 {}
13 | ^ not found in this scope
14
15 error[E0425]: cannot find value `i` in this scope
16 --> $DIR/bad-if-let-suggestion.rs:13:9
17 |
18 LL | fn a() {
19 | ------ similarly named function `a` defined here
20 ...
21 LL | if (i + j) = i {}
22 | ^ help: a function with a similar name exists: `a`
23
24 error[E0425]: cannot find value `j` in this scope
25 --> $DIR/bad-if-let-suggestion.rs:13:13
26 |
27 LL | fn a() {
28 | ------ similarly named function `a` defined here
29 ...
30 LL | if (i + j) = i {}
31 | ^ help: a function with a similar name exists: `a`
32
33 error[E0425]: cannot find value `i` in this scope
34 --> $DIR/bad-if-let-suggestion.rs:13:18
35 |
36 LL | fn a() {
37 | ------ similarly named function `a` defined here
38 ...
39 LL | if (i + j) = i {}
40 | ^ help: a function with a similar name exists: `a`
41
42 error[E0425]: cannot find value `x` in this scope
43 --> $DIR/bad-if-let-suggestion.rs:20:8
44 |
45 LL | fn a() {
46 | ------ similarly named function `a` defined here
47 ...
48 LL | if x[0] = 1 {}
49 | ^ help: a function with a similar name exists: `a`
50
51 error[E0658]: `let` expressions in this position are unstable
52 --> $DIR/bad-if-let-suggestion.rs:5:8
53 |
54 LL | if let x = 1 && i = 2 {}
55 | ^^^^^^^^^
56 |
57 = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
58 = help: add `#![feature(let_chains)]` to the crate attributes to enable
59
60 error[E0308]: mismatched types
61 --> $DIR/bad-if-let-suggestion.rs:5:8
62 |
63 LL | if let x = 1 && i = 2 {}
64 | ^^^^^^^^^^^^^^^^^^ expected `bool`, found `()`
65
66 error: aborting due to 8 previous errors
67
68 Some errors have detailed explanations: E0308, E0425, E0658.
69 For more information about an error, try `rustc --explain E0308`.