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