Repository: rust
Issue: Tracking Issue for `extern "rust-cold"` ABI (feature `rust_cold_cc`)
Labels: C-tracking-issue,A-ABI

<!--
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 experimental `extern "rust-cold"` ABI.
The feature gate for the issue is `#![feature(rust_cold_cc)]`.

This allows emitting functions with [`coldcc` in LLVM](https://llvm.org/docs/LangRef.html#calling-conventions) and [`CallConv::Cold` in cranelift](https://docs.rs/cranelift-codegen/latest/cranelift_codegen/isa/enum.CallConv.html#variant.Cold).  These are more aggressive than the stable `#[cold]`, as they can use a different calling convention (and thus have incompatible `fn`s), not just affect branch weights -- for example, they might require more/slower code in the callee in exchange for smaller call sites.

### 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.
-->

- [x] Implement 
- [ ] 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.
-->
- [ ] How can we make using this compatible with mixing codegen backends -- particularly in the context of using an LLVM-compiled standard library with a cranelift-compiled binary or tests cc https://github.com/rust-lang/rust/pull/115260#discussion_r1306642032
- [x] Should this be `coldcc`, `preservemost_cc`, or something else in LLVM?
  - clang offers `clang::preserve_most` but nothing named "cold", FWIW: <https://clang.llvm.org/docs/AttributeReference.html#calling-conventions>  
  - As a Rust-* convention we're not promising anything, so can always change the details later.

### Implementation history

<!--
Include a list of all the PRs that were involved in implementing the feature.
-->
- [x] #97512
- [x] Don't use `coldcc` https://github.com/rust-lang/rust/pull/115260
- [ ] https://github.com/rust-lang/rust/pull/130667 - Suppresses `extern "C"` improper ctypes lint, since this is a Rust ABI