@@ -49,6 +49,11 @@ pub enum ExternAbi {
4949 /// forcing callers to save all registers.
5050 RustPreserveNone ,
5151
52+ /// Ensures that calls in tail position can always be optimized into a jump.
53+ ///
54+ /// This ABI is not stable, and relies on LLVM implementation details.
55+ RustTail ,
56+
5257 /// Unstable impl detail that directly uses Rust types to describe the ABI to LLVM.
5358 /// Even normally-compatible Rust types can become ABI-incompatible with this ABI!
5459 Unadjusted ,
@@ -199,6 +204,7 @@ abi_impls! {
199204 RustCold =><= "rust-cold" ,
200205 RustInvalid =><= "rust-invalid" ,
201206 RustPreserveNone =><= "rust-preserve-none" ,
207+ RustTail =><= "rust-tail" ,
202208 Stdcall { unwind: false } =><= "stdcall" ,
203209 Stdcall { unwind: true } =><= "stdcall-unwind" ,
204210 System { unwind: false } =><= "system" ,
@@ -280,7 +286,7 @@ impl ExternAbi {
280286 /// - are subject to change between compiler versions
281287 pub fn is_rustic_abi ( self ) -> bool {
282288 use ExternAbi :: * ;
283- matches ! ( self , Rust | RustCall | RustCold | RustPreserveNone )
289+ matches ! ( self , Rust | RustCall | RustCold | RustPreserveNone | RustTail )
284290 }
285291
286292 /// Returns whether the ABI supports C variadics. This only controls whether we allow *imports*
@@ -354,6 +360,7 @@ impl ExternAbi {
354360 | Self :: SysV64 { .. }
355361 | Self :: Win64 { .. }
356362 | Self :: RustPreserveNone
363+ | Self :: RustTail
357364 | Self :: Swift => true ,
358365 }
359366 }
0 commit comments