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
4 LL | let Some(n) = opt && n == 1 else {
7 help: wrap the expression in parentheses
9 LL | let Some(n) = (opt && n == 1) else {
12 error: expected expression, found `let` statement
13 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:26
15 LL | let Some(n) = opt && let another = n else {
18 error: a `&&` expression cannot be directly assigned in `let...else`
19 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:19
21 LL | let Some(n) = opt && let another = n else {
22 | ^^^^^^^^^^^^^^^^^^^^^^
24 help: wrap the expression in parentheses
26 LL | let Some(n) = (opt && let another = n) else {
29 error: this `if` expression is missing a block after the condition
30 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:24:5
32 LL | if let Some(n) = opt else {
35 help: add a block here
36 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:24:25
38 LL | if let Some(n) = opt else {
41 error: this `if` expression is missing a block after the condition
42 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:28:5
44 LL | if let Some(n) = opt && n == 1 else {
47 help: add a block here
48 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:28:35
50 LL | if let Some(n) = opt && n == 1 else {
53 error: this `if` expression is missing a block after the condition
54 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:32:5
56 LL | if let Some(n) = opt && let another = n else {
59 help: add a block here
60 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:32:44
62 LL | if let Some(n) = opt && let another = n else {
65 error: expected `{`, found keyword `else`
66 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:38:33
68 LL | while let Some(n) = opt else {
69 | ----- ----------------- ^^^^ expected `{`
71 | | this `while` condition successfully parsed
72 | while parsing the body of this `while` expression
74 error: expected `{`, found keyword `else`
75 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:44:43
77 LL | while let Some(n) = opt && n == 1 else {
78 | ----- --------------------------- ^^^^ expected `{`
80 | | this `while` condition successfully parsed
81 | while parsing the body of this `while` expression
83 error: expected `{`, found keyword `else`
84 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:50:52
86 LL | while let Some(n) = opt && let another = n else {
87 | ----- ------------------------------------ ^^^^ expected `{`
89 | | this `while` condition successfully parsed
90 | while parsing the body of this `while` expression
92 error: `let` expressions are not supported here
93 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:26
95 LL | let Some(n) = opt && let another = n else {
98 = note: only supported directly in conditions of `if` and `while` expressions
100 error[E0308]: mismatched types
101 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:9:19
103 LL | let Some(n) = opt && n == 1 else {
104 | ^^^ expected `bool`, found enum `Option`
106 = note: expected type `bool`
107 found enum `Option<i32>`
109 error[E0308]: mismatched types
110 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:9:9
112 LL | let Some(n) = opt && n == 1 else {
113 | ^^^^^^^ ------------- this expression has type `bool`
115 | expected `bool`, found enum `Option`
117 = note: expected type `bool`
118 found enum `Option<_>`
120 error[E0308]: mismatched types
121 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:19
123 LL | let Some(n) = opt && let another = n else {
124 | ^^^ expected `bool`, found enum `Option`
126 = note: expected type `bool`
127 found enum `Option<i32>`
129 error[E0308]: mismatched types
130 --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:9
132 LL | let Some(n) = opt && let another = n else {
133 | ^^^^^^^ ---------------------- this expression has type `bool`
135 | expected `bool`, found enum `Option`
137 = note: expected type `bool`
138 found enum `Option<_>`
140 error: aborting due to 14 previous errors
142 For more information about this error, try `rustc --explain E0308`.