2022-03-15 20:00:16 +00:00
|
|
|
error: a `&&` expression cannot be directly assigned in `let...else`
|
|
|
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:9:19
|
|
|
|
|
|
|
|
|
LL | let Some(n) = opt && n == 1 else {
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: wrap the expression in parentheses
|
|
|
|
|
|
|
|
|
LL | let Some(n) = (opt && n == 1) else {
|
|
|
|
| + +
|
|
|
|
|
2022-06-25 11:08:38 +00:00
|
|
|
error: expected expression, found `let` statement
|
|
|
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:26
|
|
|
|
|
|
|
|
|
LL | let Some(n) = opt && let another = n else {
|
|
|
|
| ^^^
|
|
|
|
|
2022-03-15 20:00:16 +00:00
|
|
|
error: a `&&` expression cannot be directly assigned in `let...else`
|
|
|
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:19
|
|
|
|
|
|
|
|
|
LL | let Some(n) = opt && let another = n else {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: wrap the expression in parentheses
|
|
|
|
|
|
|
|
|
LL | let Some(n) = (opt && let another = n) else {
|
|
|
|
| + +
|
|
|
|
|
2022-05-28 04:58:48 +00:00
|
|
|
error: this `if` expression is missing a block after the condition
|
2022-06-25 11:08:38 +00:00
|
|
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:24:5
|
2022-03-15 20:00:16 +00:00
|
|
|
|
|
|
|
|
LL | if let Some(n) = opt else {
|
2022-05-28 04:58:48 +00:00
|
|
|
| ^^
|
|
|
|
|
|
|
|
|
help: add a block here
|
2022-06-25 11:08:38 +00:00
|
|
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:24:25
|
2022-05-28 04:58:48 +00:00
|
|
|
|
|
|
|
|
LL | if let Some(n) = opt else {
|
|
|
|
| ^
|
2023-01-24 04:31:45 +00:00
|
|
|
help: remove the `if` if you meant to write a `let...else` statement
|
|
|
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:24:5
|
|
|
|
|
|
|
|
|
LL | if let Some(n) = opt else {
|
|
|
|
| ^^
|
2022-03-15 20:00:16 +00:00
|
|
|
|
2022-05-28 04:58:48 +00:00
|
|
|
error: this `if` expression is missing a block after the condition
|
2022-06-25 11:08:38 +00:00
|
|
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:28:5
|
2022-03-15 20:00:16 +00:00
|
|
|
|
|
|
|
|
LL | if let Some(n) = opt && n == 1 else {
|
2022-05-28 04:58:48 +00:00
|
|
|
| ^^
|
|
|
|
|
|
|
|
|
help: add a block here
|
2022-06-25 11:08:38 +00:00
|
|
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:28:35
|
2022-05-28 04:58:48 +00:00
|
|
|
|
|
|
|
|
LL | if let Some(n) = opt && n == 1 else {
|
|
|
|
| ^
|
2022-03-15 20:00:16 +00:00
|
|
|
|
2022-05-28 04:58:48 +00:00
|
|
|
error: this `if` expression is missing a block after the condition
|
2022-06-25 11:08:38 +00:00
|
|
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:32:5
|
2022-05-28 04:58:48 +00:00
|
|
|
|
|
|
|
|
LL | if let Some(n) = opt && let another = n else {
|
|
|
|
| ^^
|
|
|
|
|
|
|
|
|
help: add a block here
|
2022-06-25 11:08:38 +00:00
|
|
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:32:44
|
2022-03-15 20:00:16 +00:00
|
|
|
|
|
|
|
|
LL | if let Some(n) = opt && let another = n else {
|
2022-05-28 04:58:48 +00:00
|
|
|
| ^
|
2022-03-15 20:00:16 +00:00
|
|
|
|
|
|
|
error: expected `{`, found keyword `else`
|
2022-06-25 11:08:38 +00:00
|
|
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:38:33
|
2022-03-15 20:00:16 +00:00
|
|
|
|
|
|
|
|
LL | while let Some(n) = opt else {
|
|
|
|
| ----- ----------------- ^^^^ expected `{`
|
|
|
|
| | |
|
|
|
|
| | this `while` condition successfully parsed
|
|
|
|
| while parsing the body of this `while` expression
|
|
|
|
|
|
|
|
error: expected `{`, found keyword `else`
|
2022-06-25 11:08:38 +00:00
|
|
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:44:43
|
2022-03-15 20:00:16 +00:00
|
|
|
|
|
|
|
|
LL | while let Some(n) = opt && n == 1 else {
|
|
|
|
| ----- --------------------------- ^^^^ expected `{`
|
|
|
|
| | |
|
|
|
|
| | this `while` condition successfully parsed
|
|
|
|
| while parsing the body of this `while` expression
|
|
|
|
|
|
|
|
error: expected `{`, found keyword `else`
|
2022-06-25 11:08:38 +00:00
|
|
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:50:52
|
2022-03-15 20:00:16 +00:00
|
|
|
|
|
|
|
|
LL | while let Some(n) = opt && let another = n else {
|
|
|
|
| ----- ------------------------------------ ^^^^ expected `{`
|
|
|
|
| | |
|
|
|
|
| | this `while` condition successfully parsed
|
|
|
|
| while parsing the body of this `while` expression
|
|
|
|
|
|
|
|
error: `let` expressions are not supported here
|
|
|
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:26
|
|
|
|
|
|
|
|
|
LL | let Some(n) = opt && let another = n else {
|
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: only supported directly in conditions of `if` and `while` expressions
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:9:19
|
|
|
|
|
|
|
|
|
LL | let Some(n) = opt && n == 1 else {
|
|
|
|
| ^^^ expected `bool`, found enum `Option`
|
|
|
|
|
|
|
|
|
= note: expected type `bool`
|
|
|
|
found enum `Option<i32>`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:9:9
|
|
|
|
|
|
|
|
|
LL | let Some(n) = opt && n == 1 else {
|
|
|
|
| ^^^^^^^ ------------- this expression has type `bool`
|
|
|
|
| |
|
|
|
|
| expected `bool`, found enum `Option`
|
|
|
|
|
|
|
|
|
= note: expected type `bool`
|
|
|
|
found enum `Option<_>`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:19
|
|
|
|
|
|
|
|
|
LL | let Some(n) = opt && let another = n else {
|
|
|
|
| ^^^ expected `bool`, found enum `Option`
|
|
|
|
|
|
|
|
|
= note: expected type `bool`
|
|
|
|
found enum `Option<i32>`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:9
|
|
|
|
|
|
|
|
|
LL | let Some(n) = opt && let another = n else {
|
|
|
|
| ^^^^^^^ ---------------------- this expression has type `bool`
|
|
|
|
| |
|
|
|
|
| expected `bool`, found enum `Option`
|
|
|
|
|
|
|
|
|
= note: expected type `bool`
|
|
|
|
found enum `Option<_>`
|
|
|
|
|
2022-06-25 11:08:38 +00:00
|
|
|
error: aborting due to 14 previous errors
|
2022-03-15 20:00:16 +00:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|