rust/compiler/rustc_trait_selection
Matthias Krüger c43893005e
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.
2025-01-17 09:11:18 +01:00
..
src Rollup merge of #135558 - estebank:issue-133316, r=chenyukang 2025-01-17 09:11:18 +01:00
Cargo.toml rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structures 2024-12-16 19:08:19 +01:00
messages.ftl mir_transform: implement forced inlining 2025-01-10 18:37:54 +00:00