rust/compiler/rustc_feature/src
bors 75963ce795 Auto merge of #151065 - nagisa:add-preserve-none-abi, r=petrochenkov
abi: add a rust-preserve-none calling convention

This is the conceptual opposite of the rust-cold calling convention and is particularly useful in combination with the new `explicit_tail_calls` feature.

For relatively tight loops implemented with tail calling (`become`) each of the function with the regular calling convention is still responsible for restoring the initial value of the preserved registers. So it is not unusual to end up with a situation where each step in the tail call loop is spilling and reloading registers, along the lines of:

    foo:
        push r12
        ; do things
        pop r12
        jmp next_step

This adds up quickly, especially when most of the clobberable registers are already used to pass arguments or other uses.

I was thinking of making the name of this ABI a little less LLVM-derived and more like a conceptual inverse of `rust-cold`, but could not come with a great name (`rust-cold` is itself not a great name: cold in what context? from which perspective? is it supposed to mean that the function is rarely called?)
2026-01-25 02:49:32 +00:00
..
accepted.rs Add missing documentation for globs feature 2026-01-10 13:25:31 +08:00
builtin_attrs.rs Replace #[rustc_do_not_implement_via_object] with #[rustc_dyn_incompatible_trait], which makes the marked trait dyn-incompatible. 2026-01-20 12:54:40 -06:00
lib.rs Rollup merge of #148484 - JonathanBrouwer:wip_attr_style, r=jdonszelmann 2025-11-18 16:52:11 +01:00
removed.rs Replace version placeholders with 1.94 2026-01-20 21:17:10 -05:00
tests.rs rustc_feature: Avoid unsafe std::env::set_var() in UnstableFeatures tests 2025-01-08 11:37:19 +01:00
unstable.rs Auto merge of #151065 - nagisa:add-preserve-none-abi, r=petrochenkov 2026-01-25 02:49:32 +00:00