rust/tests
Michael Goulet 8ff558b8fc
Rollup merge of #117526 - estebank:issue-24157, r=b-naber
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 19:06:46 -05:00
..
assembly Update the minimum external LLVM to 16. 2023-11-21 22:40:16 +01:00
auxiliary
codegen Auto merge of #117947 - Dirbaio:drop-llvm-15, r=cuviper 2023-11-27 21:54:03 +00:00
codegen-units Automatically enable cross-crate inlining for small functions 2023-10-17 19:53:51 -04:00
coverage coverage: Simplify building coverage expressions based on sums 2023-11-25 12:29:20 +11:00
coverage-run-rustdoc coverage: Rename the run-coverage test mode to coverage-run 2023-11-08 16:41:24 +11:00
debuginfo Check alignment of pointers only when read/written through 2023-11-04 13:01:32 -04:00
incremental Remove asmjs from tests 2023-10-28 23:11:03 -07:00
mir-opt Bless MIR tests 2023-11-26 00:14:18 +00:00
pretty Remove unnecessary CVarArgs name skipping logic 2023-10-25 17:44:17 +02:00
run-make Auto merge of #117947 - Dirbaio:drop-llvm-15, r=cuviper 2023-11-27 21:54:03 +00:00
run-make-fulldeps Merge Queries::{ongoing_codegen,linker}. 2023-11-22 13:22:49 +11:00
run-pass-valgrind
rustdoc Rollup merge of #118224 - dtolnay:rustdocsortunstable, r=fmease 2023-11-24 08:23:54 +01:00
rustdoc-gui rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
rustdoc-js rustdoc-search: avoid infinite where clause unbox 2023-11-24 10:42:11 -07:00
rustdoc-js-std rustdoc-search: make primitives and keywords less special 2023-11-21 13:59:26 -07:00
rustdoc-json rustdoc-json: Fix test so it actuall checks things 2023-11-09 12:13:16 +00:00
rustdoc-ui Manual find replace updates 2023-11-24 21:04:51 +01:00
ui Rollup merge of #117526 - estebank:issue-24157, r=b-naber 2023-11-27 19:06:46 -05:00
ui-fulldeps Use rustc_fluent_macro::fluent_messages! directly. 2023-11-26 08:38:40 +11:00
COMPILER_TESTS.md