rust/tests
Stuart Cook 35a82b8dde
Rollup merge of #148878 - folkertdev:tail-call-unsupported-abi, r=WaffleLapkin
error when ABI does not support guaranteed tail calls

Some ABIs cannot support guaranteed tail calls. There isn't really an exhaustive list, so this is a best effort. Conveniently, we already disallow calling most of these directly anyway. The only exception that I was able to trigger an LLVM assertion with so far was `cmse-nonsecure-entry`.

For that calling convention, LLVM specifically notes that  (guaranteed) tail calls cannot be supported:

28dbbba6c3/llvm/lib/Target/ARM/ARMISelLowering.cpp (L2331-L2335)

---

I have some doubts about the implementation here though. I think it would be nicer to use `CanonAbi`, and move the `become` ABI check into `rustc_hir_typeck`, similar to `check_call_abi`:

d6deffe2de/compiler/rustc_hir_typeck/src/callee.rs (L157-L194)

Both the check for whether an ABI is callable and whether it supports guaranteed tail calls can then be methods (containing exhaustive matches) on `CanonAbi`. I'm however not sure

- if the ABI checks are deliberately only performed when constructing MIR
- what assumptions can be made about the `call` expression in [`check_expr_become`](d6deffe2de/compiler/rustc_hir_typeck/src/expr.rs (L1126-L1150)), it looks like currently the check that the "argument" to `become` is a function call also only occurs later during MIR construction

Are there issues with validating the ABI earlier in `rustc_hir_typeck` that I'm overlooking? I believe that we should already know the call's ABI and whether it is c-variadic at that point.

cc ````@workingjubilee```` for `CanonAbi`, ````@davidtwco```` for cmse
r? ````@WaffleLapkin````
2025-11-14 13:14:04 +11:00
..
assembly-llvm stabilize s390x_target_feature_vector 2025-11-06 12:49:48 +01:00
auxiliary Rollup merge of #147355 - sayantn:masked-loads, r=RalfJung,bjorn3 2025-11-05 10:59:18 +11:00
codegen-llvm Update tests/codegen-llvm/deduced-param-attrs.rs 2025-11-11 12:31:37 +03:00
codegen-units Document fmt::Arguments internal representation. 2025-11-12 12:48:39 +01:00
coverage Bless coverage tests. 2025-11-12 12:48:45 +01:00
coverage-run-rustdoc
crashes Check that impls of #[type_const] consts also have the attr 2025-11-08 23:05:08 -05:00
debuginfo Minor fixes to StdNonZeroNumberProvider for gdb 2025-11-05 11:42:54 -07:00
incremental Bless tests. 2025-11-12 12:48:27 +01:00
mir-opt Allow larger string pieces in fmt::Arguments repr. 2025-11-12 12:48:44 +01:00
pretty Document fmt::Arguments internal representation. 2025-11-12 12:48:39 +01:00
run-make Bless tests. 2025-11-12 12:48:27 +01:00
run-make-cargo Skip the panic-immediate-abort-works test when cross-compiling 2025-09-22 21:13:38 -04:00
rustdoc Add regression test for #148008 2025-11-13 15:34:49 +01:00
rustdoc-gui rustdoc-search: add test case for throbber 2025-10-07 12:59:58 -07:00
rustdoc-js Rollup merge of #147701 - lolbinarycat:rustdoc-search-alias-fix, r=GuillaumeGomez 2025-11-13 11:57:07 +11:00
rustdoc-js-std Add regression test for including derive macros in macro filtering 2025-10-27 16:00:32 +01:00
rustdoc-json Add tests for doc(attribute = "...") attribute 2025-08-28 15:56:30 +02:00
rustdoc-ui Rollup merge of #146495 - fmease:rustdoc-erase-doc-priv-items-attr, r=GuillaumeGomez 2025-11-11 21:09:33 +11:00
ui Rollup merge of #148878 - folkertdev:tail-call-unsupported-abi, r=WaffleLapkin 2025-11-14 13:14:04 +11:00
ui-fulldeps When more than a single impl and less than 4 could apply, point at them 2025-10-31 20:44:01 +00:00
COMPILER_TESTS.md