Repository: rust
Issue: Tracking Issue for Explicit Tail Calls
Labels: T-lang,C-tracking-issue,F-explicit_tail_calls

<!--
NOTE: For library features, please use the "Library Tracking Issue" template instead.

Thank you for creating a tracking issue! 📜 Tracking issues are for tracking a
feature from implementation to stabilisation. Make sure to include the relevant
RFC for the feature if it has one. Otherwise provide a short summary of the
feature and link any relevant PRs or issues, and remove any sections that are
not relevant to the feature.

Remember to add team labels to the tracking issue.
For a language team feature, this would e.g., be `T-lang`.
Such a feature should also be labeled with e.g., `F-my_feature`.
This label is used to associate issues (e.g., bugs and design questions) to the feature.
-->

This is a tracking issue for the RFC "Explicit Tail Calls" (rust-lang/rfcs#3407) (note that RFC is not accepted yet, this feature is currently implemented as part of an experiment).
The feature gate for the issue is `#![feature(explicit_tail_calls)]`.

### About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

### Steps
<!--
Include each step required to complete the feature. Typically this is a PR
implementing a feature, followed by a PR that stabilises the feature. However
for larger features an implementation could be broken up into multiple PRs.
-->

- [ ] Implement the RFC
    - [x] Parsing/HIR/MIR
    - [x] Implement the necessary checks for tail calls (draft commit: https://github.com/rust-lang/rust/pull/112657/commits/20c26dc5113bb9c65a43d3b5b3e32299bc962563)
    - [ ] Add support in LLVM backend (draft commits: https://github.com/rust-lang/rust/pull/112657/commits/dee279d5a81f3ad2e07a90365da49ff7e382feeb, https://github.com/rust-lang/rust/pull/112657/commits/0722a1ec41a4f903707ca2b75d6644f89ac2a1f9)
- [ ] Adjust documentation ([see instructions on rustc-dev-guide][doc-guide])
- [ ] Stabilization PR ([see instructions on rustc-dev-guide][stabilization-guide])

[stabilization-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#stabilization-pr
[doc-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#documentation-prs

### Unresolved Questions
<!--
Include any open questions that need to be answered before the feature can be
stabilised.
-->

(fill when the rfc is merged)

<!--
Include a list of all the PRs that were involved in implementing the feature.
-->

```[tasklist]
### Implementation history
- [ ] https://github.com/rust-lang/rust/pull/112790
- [ ] https://github.com/rust-lang/rust/pull/112791
- [ ] https://github.com/rust-lang/rust/pull/112887
- [ ] https://github.com/rust-lang/rust/pull/113093
- [ ] https://github.com/rust-lang/rust/pull/113095
- [ ] https://github.com/rust-lang/rust/pull/113128
- [ ] https://github.com/rust-lang/rust/pull/133607
- [ ] https://github.com/rust-lang/rust/pull/135973
- [ ] https://github.com/rust-lang/rust/pull/135976
```