diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2025-01-17 09:11:18 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-17 09:11:18 +0100 |
| commit | c43893005e5e31663366c478e48c4e236f7d0587 (patch) | |
| tree | a205e8fbdceb2ee7992988f7d97edf3224df6953 /compiler/rustc_codegen_gcc/src/errors.rs | |
| parent | dbdfa7914c07ee37857302a46c6b8bd797e33ff5 (diff) | |
| parent | f78a1bd89ade0d326a47222e51c61bd631530416 (diff) | |
| download | rust-c43893005e5e31663366c478e48c4e236f7d0587.tar.gz rust-c43893005e5e31663366c478e48c4e236f7d0587.zip | |
Rollup merge of #135558 - estebank:issue-133316, r=chenyukang
Detect if-else chains with a missing final else in type errors
```
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.
Diffstat (limited to 'compiler/rustc_codegen_gcc/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
