rust/tests
bors 9af6fee87d Auto merge of #113128 - WaffleLapkin:become_trully_unuwuable, r=oli-obk,RalfJung
Support tail calls in mir via `TerminatorKind::TailCall`

This is one of the interesting bits in tail call implementation — MIR support.

This adds a new `TerminatorKind` which represents a tail call:
```rust
    TailCall {
        func: Operand<'tcx>,
        args: Vec<Operand<'tcx>>,
        fn_span: Span,
    },
```

*Structurally* this is very similar to a normal `Call` but is missing a few fields:
- `destination` — tail calls don't write to destination, instead they pass caller's destination to the callee (such that eventual `return` will write to the caller of the function that used tail call)
- `target` — similarly to `destination` tail calls pass the caller's return address to the callee, so there is nothing to do
- `unwind` — I _think_ this is applicable too, although it's a bit confusing
- `call_source` — `become` forbids operators and is not created as a lowering of something else; tail calls always come from HIR (at least for now)

It might be helpful to read the interpreter implementation to understand what `TailCall` means exactly, although I've tried documenting it too.

-----

There are a few `FIXME`-questions still left, ideally we'd be able to answer them during review ':)

-----

r? `@oli-obk`
cc `@scottmcm` `@DrMeepster` `@JakobDegen`
2024-07-08 04:35:04 +00:00
..
assembly Always preserve user-written comments in assembly 2024-07-02 21:41:59 -04:00
auxiliary
codegen Use the aligned size for alloca at ret when the pass mode is cast. 2024-07-02 06:33:40 +08:00
codegen-units Avoid MIR bloat in inlining 2024-07-01 05:17:13 -07:00
coverage Rollup merge of #126956 - joboet:fmt_no_extern_ty, r=RalfJung 2024-06-28 08:34:08 +02:00
coverage-run-rustdoc
crashes Rollup merge of #127409 - gurry:127332-ice-with-expr-not-struct, r=oli-obk 2024-07-07 14:22:02 +02:00
debuginfo Add debuginfo tests for collapse_debuginfo for statics. 2024-06-13 16:04:31 +02:00
incremental Auto merge of #126409 - pacak:incr-uplorry, r=michaelwoerister 2024-06-20 09:06:16 +00:00
mir-opt Properly handle drops for tail calls 2024-07-07 17:11:05 +02:00
pretty
run-make Auto merge of #127335 - Oneirical:put-on-a-petestal, r=jieyouxu 2024-07-07 01:05:25 +00:00
run-pass-valgrind
rustdoc Migrate tests to use `-Znext-solver` 2024-06-30 17:08:45 +00:00
rustdoc-gui Don't call `switch-theme` function 2024-06-29 11:56:06 +02:00
rustdoc-js
rustdoc-js-std
rustdoc-json rustdoc-json: Better representation of lifetime bounds in where clauses. 2024-07-03 20:00:56 +00:00
rustdoc-ui Rollup merge of #127301 - estebank:fix-suggestions, r=Urgau 2024-07-04 18:16:24 +02:00
ui Auto merge of #113128 - WaffleLapkin:become_trully_unuwuable, r=oli-obk,RalfJung 2024-07-08 04:35:04 +00:00
ui-fulldeps Rollup merge of #127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix 2024-07-05 20:49:31 -04:00
COMPILER_TESTS.md