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
..
2024-04-12 12:59:40 +09:00
2024-06-19 19:12:00 +10:00
2024-06-19 00:27:41 +02:00
2024-07-04 22:05:00 +08:00
2024-06-03 07:25:32 +02:00
2024-02-16 20:02:50 +00:00
2024-06-20 04:25:17 +00:00
2024-03-01 02:03:00 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-07-07 17:11:04 +02:00
2024-07-07 17:11:04 +02:00
2024-02-16 20:02:50 +00:00
2024-02-20 16:09:09 +00:00
2024-02-20 16:09:09 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-03-01 02:03:00 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-05-22 19:47:32 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-03-08 20:56:25 +00:00
2024-04-12 12:59:40 +09:00
2024-03-12 21:32:21 +01:00
2024-03-12 21:32:21 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-06-04 14:19:42 -03:00
2024-06-04 14:19:42 -03:00
2024-05-11 15:49:51 -07:00
2024-05-11 15:49:51 -07:00
2024-02-22 18:05:28 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-04-22 17:47:35 +02:00
2024-04-22 17:47:35 +02:00
2024-04-22 17:47:35 +02:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-28 20:59:32 +11:00
2024-02-28 20:59:32 +11:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-06-04 14:19:43 -03:00
2024-06-26 08:50:50 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-03-07 23:03:42 +00:00
2024-03-07 23:03:42 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-14 21:04:51 +00:00
2024-03-18 16:08:58 +00:00
2024-02-16 20:02:50 +00:00
2024-03-05 00:12:15 +01:00
2024-03-05 00:12:15 +01:00
2024-06-30 17:08:45 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-04-21 15:43:43 -03:00
2024-04-21 15:43:43 -03:00
2024-04-21 15:43:43 -03:00
2024-04-21 15:43:43 -03:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-01 16:18:03 +01:00
2024-02-01 16:18:03 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-14 20:15:13 +00:00
2024-05-18 18:12:18 +02:00
2024-01-29 11:25:09 +11:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-03-01 02:03:00 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-03-01 02:03:00 +00:00
2024-06-04 14:19:43 -03:00
2024-06-26 08:50:50 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-03-22 17:25:57 +01:00
2024-03-22 17:25:57 +01:00
2024-02-16 20:02:50 +00:00
2024-01-28 16:12:21 +01:00
2024-01-28 16:12:21 +01:00
2024-01-28 16:12:21 +01:00
2024-01-28 16:12:21 +01:00
2024-01-28 16:12:21 +01:00
2024-01-28 16:12:21 +01:00
2024-01-28 16:12:21 +01:00
2024-01-28 16:12:21 +01:00
2024-01-28 16:12:21 +01:00
2024-01-28 16:12:21 +01:00
2024-01-28 16:12:21 +01:00
2024-01-28 16:12:21 +01:00
2024-01-28 16:12:21 +01:00
2024-01-28 16:12:21 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-01-30 21:28:18 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-05-20 19:55:59 -07:00
2024-03-18 21:35:18 -07:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-06-17 22:35:25 -04:00
2024-06-17 22:35:25 -04:00
2024-02-09 20:47:50 -08:00
2024-02-16 20:02:50 +00:00
2024-04-12 12:59:40 +09:00
2024-04-12 12:59:40 +09:00
2024-04-12 12:59:40 +09:00
2024-02-16 20:02:50 +00:00
2024-02-14 20:15:13 +00:00
2024-02-16 20:02:50 +00:00
2024-03-17 23:35:18 +00:00
2024-03-17 23:35:18 +00:00
2024-03-17 23:35:18 +00:00
2024-06-05 09:35:57 -03:00
2024-06-29 14:40:32 -03:00
2024-06-05 09:35:57 -03:00
2024-06-28 23:13:33 -03:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-06-01 20:57:15 +02:00
2024-06-01 20:57:15 +02:00
2024-06-22 23:30:31 -07:00
2024-06-22 23:30:31 -07:00
2024-02-16 20:02:50 +00:00