```
error[E0308]: `if` and `else` have incompatible types
--> $DIR/if-else-chain-missing-else.rs:12:12
|
LL | let x = if let Ok(x) = res {
| ______________-
LL | | x
| | - expected because of this
LL | | } else if let Err(e) = res {
| | ____________^
LL | || return Err(e);
LL | || };
| || ^
| ||_____|
| |_____`if` and `else` have incompatible types
| expected `i32`, found `()`
|
= note: `if` expressions without `else` evaluate to `()`
= note: consider adding an `else` block that evaluates to the expected type
```
We probably want a longer explanation and fewer spans on this case.
Partially address #133316.
|
||
|---|---|---|
| .. | ||
| compound-assignment | ||
| if | ||
| malformed_closure | ||
| block-fn.rs | ||
| block-generic.rs | ||
| block.rs | ||
| copy.rs | ||
| if-bot.rs | ||
| if-generic.rs | ||
| if-panic-all.rs | ||
| issue-22933-1.rs | ||
| issue-22933-2.rs | ||
| issue-22933-2.stderr | ||
| scope.rs | ||