rust/tests
Esteban Küber 8221f9c837 Account for ! arm in tail match expr
On functions with a default return type that influences the coerced type
of `match` arms, check if the failing arm is actually of type `!`. If
so, suggest changing the return type so the coercion against the prior
arms is successful.

```
error[E0308]: `match` arms have incompatible types
  --> $DIR/match-tail-expr-never-type-error.rs:9:13
   |
LL |   fn bar(a: bool) {
   |                  - help: try adding a return type: `-> i32`
LL | /     match a {
LL | |         true => 1,
   | |                 - this is found to be of type `{integer}`
LL | |         false => {
LL | |             never()
   | |             ^^^^^^^
   | |             |
   | |             expected integer, found `()`
   | |             this expression is of type `!`, but it get's coerced to `()` due to its surrounding expression
LL | |         }
LL | |     }
   | |_____- `match` arms have incompatible types
```

Fix #24157.
2023-11-27 16:19:02 +00:00
..
assembly
auxiliary
codegen
codegen-units
coverage coverage: Simplify building coverage expressions based on sums 2023-11-25 12:29:20 +11:00
coverage-run-rustdoc
debuginfo
incremental
mir-opt Bless MIR tests 2023-11-26 00:14:18 +00:00
pretty
run-make
run-make-fulldeps
run-pass-valgrind
rustdoc
rustdoc-gui
rustdoc-js
rustdoc-js-std
rustdoc-json
rustdoc-ui
ui Account for ! arm in tail match expr 2023-11-27 16:19:02 +00:00
ui-fulldeps Use rustc_fluent_macro::fluent_messages! directly. 2023-11-26 08:38:40 +11:00
COMPILER_TESTS.md