]> git.proxmox.com Git - rustc.git/blob - src/test/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / rfc-2497-if-let-chains / ensure-that-let-else-does-not-interact-with-let-chains.stderr
1 error: a `&&` expression cannot be directly assigned in `let...else`
2 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:9:19
3 |
4 LL | let Some(n) = opt && n == 1 else {
5 | ^^^^^^^^^^^^^
6 |
7 help: wrap the expression in parentheses
8 |
9 LL | let Some(n) = (opt && n == 1) else {
10 | + +
11
12 error: a `&&` expression cannot be directly assigned in `let...else`
13 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:19
14 |
15 LL | let Some(n) = opt && let another = n else {
16 | ^^^^^^^^^^^^^^^^^^^^^^
17 |
18 help: wrap the expression in parentheses
19 |
20 LL | let Some(n) = (opt && let another = n) else {
21 | + +
22
23 error: this `if` expression is missing a block after the condition
24 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:23:5
25 |
26 LL | if let Some(n) = opt else {
27 | ^^
28 |
29 help: add a block here
30 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:23:25
31 |
32 LL | if let Some(n) = opt else {
33 | ^
34
35 error: this `if` expression is missing a block after the condition
36 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:27:5
37 |
38 LL | if let Some(n) = opt && n == 1 else {
39 | ^^
40 |
41 help: add a block here
42 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:27:35
43 |
44 LL | if let Some(n) = opt && n == 1 else {
45 | ^
46
47 error: this `if` expression is missing a block after the condition
48 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:31:5
49 |
50 LL | if let Some(n) = opt && let another = n else {
51 | ^^
52 |
53 help: add a block here
54 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:31:44
55 |
56 LL | if let Some(n) = opt && let another = n else {
57 | ^
58
59 error: expected `{`, found keyword `else`
60 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:37:33
61 |
62 LL | while let Some(n) = opt else {
63 | ----- ----------------- ^^^^ expected `{`
64 | | |
65 | | this `while` condition successfully parsed
66 | while parsing the body of this `while` expression
67
68 error: expected `{`, found keyword `else`
69 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:43:43
70 |
71 LL | while let Some(n) = opt && n == 1 else {
72 | ----- --------------------------- ^^^^ expected `{`
73 | | |
74 | | this `while` condition successfully parsed
75 | while parsing the body of this `while` expression
76
77 error: expected `{`, found keyword `else`
78 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:49:52
79 |
80 LL | while let Some(n) = opt && let another = n else {
81 | ----- ------------------------------------ ^^^^ expected `{`
82 | | |
83 | | this `while` condition successfully parsed
84 | while parsing the body of this `while` expression
85
86 error: `let` expressions are not supported here
87 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:26
88 |
89 LL | let Some(n) = opt && let another = n else {
90 | ^^^^^^^^^^^^^^^
91 |
92 = note: only supported directly in conditions of `if` and `while` expressions
93
94 error[E0308]: mismatched types
95 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:9:19
96 |
97 LL | let Some(n) = opt && n == 1 else {
98 | ^^^ expected `bool`, found enum `Option`
99 |
100 = note: expected type `bool`
101 found enum `Option<i32>`
102
103 error[E0308]: mismatched types
104 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:9:9
105 |
106 LL | let Some(n) = opt && n == 1 else {
107 | ^^^^^^^ ------------- this expression has type `bool`
108 | |
109 | expected `bool`, found enum `Option`
110 |
111 = note: expected type `bool`
112 found enum `Option<_>`
113
114 error[E0308]: mismatched types
115 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:19
116 |
117 LL | let Some(n) = opt && let another = n else {
118 | ^^^ expected `bool`, found enum `Option`
119 |
120 = note: expected type `bool`
121 found enum `Option<i32>`
122
123 error[E0308]: mismatched types
124 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:9
125 |
126 LL | let Some(n) = opt && let another = n else {
127 | ^^^^^^^ ---------------------- this expression has type `bool`
128 | |
129 | expected `bool`, found enum `Option`
130 |
131 = note: expected type `bool`
132 found enum `Option<_>`
133
134 error: aborting due to 13 previous errors
135
136 For more information about this error, try `rustc --explain E0308`.