If you’re going to specifically identify tail call functions, you can just switch the calling convention to a custom callee-cleanup one, which allows the number of arguments to change (without having to do any magic with calculating stack sizes in advance). See also this ancient bug and this RFC bug.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Pre-RFC: explicit proper tail calls | 15 | 14775 | November 29, 2016 | |
|
If become was implemented, could it be supported everywhere?
|
4 | 2532 | January 23, 2017 | |
| Should the tail recursion expression be called `become`, or something else? | 122 | 5890 | September 3, 2025 | |
| Clang attribute [[musttail]] in Rust? | 14 | 3154 | October 18, 2022 | |
| When will Rust have TCO/TCE? A proposal on the subject | 15 | 4242 | September 30, 2018 |