From f49e45101c7678845f920fe43ff621cf92012dfb Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Sun, 26 Apr 2026 12:09:05 +0200 Subject: [PATCH] Add Swift function call ABI Adds an unstable `extern "Swift"` ABI behind the `abi_swift` feature gate, mapping to LLVM's `swiftcc` calling convention. Cranelift and GCC backends fall back to the platform default since they have no equivalent. --- compiler/rustc_abi/src/canon_abi.rs | 6 ++ compiler/rustc_abi/src/extern_abi.rs | 8 +- compiler/rustc_ast_lowering/src/stability.rs | 3 + .../rustc_ast_passes/src/ast_validation.rs | 1 + .../rustc_codegen_cranelift/src/abi/mod.rs | 2 +- compiler/rustc_codegen_gcc/src/abi.rs | 2 + compiler/rustc_codegen_llvm/src/abi.rs | 1 + compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 1 + compiler/rustc_feature/src/unstable.rs | 2 + compiler/rustc_hir_typeck/src/callee.rs | 1 + compiler/rustc_middle/src/ty/layout.rs | 1 + compiler/rustc_public/src/abi.rs | 2 + compiler/rustc_public/src/ty.rs | 1 + .../src/unstable/convert/internal.rs | 1 + .../src/unstable/convert/stable/abi.rs | 1 + .../src/unstable/convert/stable/ty.rs | 1 + compiler/rustc_span/src/symbol.rs | 1 + compiler/rustc_target/src/spec/abi_map.rs | 16 +++- tests/ui/abi/swift-abi-non-apple.rs | 33 +++++++++ tests/ui/abi/swift-abi-non-apple.stderr | 45 ++++++++++++ .../feature-gates/feature-gate-abi_swift.rs | 33 +++++++++ .../feature-gate-abi_swift.stderr | 73 +++++++++++++++++++ .../print-calling-conventions.stdout | 1 + 23 files changed, 233 insertions(+), 3 deletions(-) create mode 100644 tests/ui/abi/swift-abi-non-apple.rs create mode 100644 tests/ui/abi/swift-abi-non-apple.stderr create mode 100644 tests/ui/feature-gates/feature-gate-abi_swift.rs create mode 100644 tests/ui/feature-gates/feature-gate-abi_swift.stderr diff --git a/compiler/rustc_abi/src/canon_abi.rs b/compiler/rustc_abi/src/canon_abi.rs index 3ef3fa365298..316cb05ec180 100644 --- a/compiler/rustc_abi/src/canon_abi.rs +++ b/compiler/rustc_abi/src/canon_abi.rs @@ -32,6 +32,10 @@ pub enum CanonAbi { /// An ABI that rustc does not know how to call or define. Custom, + /// Swift calling convention, exposed via LLVM's `swiftcc`. Cross-platform + /// and not tied to a specific target architecture. + Swift, + /// ABIs relevant to 32-bit Arm targets Arm(ArmCall), /// ABI relevant to GPUs: the entry point for a GPU kernel @@ -58,6 +62,7 @@ pub fn is_rustic_abi(self) -> bool { CanonAbi::Rust | CanonAbi::RustCold | CanonAbi::RustPreserveNone => true, CanonAbi::C | CanonAbi::Custom + | CanonAbi::Swift | CanonAbi::Arm(_) | CanonAbi::GpuKernel | CanonAbi::Interrupt(_) @@ -77,6 +82,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { CanonAbi::RustCold => ExternAbi::RustCold, CanonAbi::RustPreserveNone => ExternAbi::RustPreserveNone, CanonAbi::Custom => ExternAbi::Custom, + CanonAbi::Swift => ExternAbi::Swift, CanonAbi::Arm(arm_call) => match arm_call { ArmCall::Aapcs => ExternAbi::Aapcs { unwind: false }, ArmCall::CCmseNonSecureCall => ExternAbi::CmseNonSecureCall, diff --git a/compiler/rustc_abi/src/extern_abi.rs b/compiler/rustc_abi/src/extern_abi.rs index bba01ebefca8..3def8a8ccf0b 100644 --- a/compiler/rustc_abi/src/extern_abi.rs +++ b/compiler/rustc_abi/src/extern_abi.rs @@ -62,6 +62,10 @@ pub enum ExternAbi { /// and only valid on platforms that have a UEFI standard EfiApi, + /// Swift's calling convention, used to interoperate with Swift code without + /// going through C as an intermediary. + Swift, + /* arm */ /// Arm Architecture Procedure Call Standard, sometimes `ExternAbi::C` is an alias for this Aapcs { @@ -173,6 +177,7 @@ fn from_str(s: &str) -> Result<$e_name, Self::Err> { C { unwind: false } =><= "C", C { unwind: true } =><= "C-unwind", Rust =><= "Rust", + Swift =><= "Swift", Aapcs { unwind: false } =><= "aapcs", Aapcs { unwind: true } =><= "aapcs-unwind", AvrInterrupt =><= "avr-interrupt", @@ -348,7 +353,8 @@ pub fn supports_guaranteed_tail_call(self) -> bool { | Self::Vectorcall { .. } | Self::SysV64 { .. } | Self::Win64 { .. } - | Self::RustPreserveNone => true, + | Self::RustPreserveNone + | Self::Swift => true, } } } diff --git a/compiler/rustc_ast_lowering/src/stability.rs b/compiler/rustc_ast_lowering/src/stability.rs index 326576bb1488..00b6a353d93f 100644 --- a/compiler/rustc_ast_lowering/src/stability.rs +++ b/compiler/rustc_ast_lowering/src/stability.rs @@ -144,5 +144,8 @@ pub fn extern_abi_stability(abi: ExternAbi) -> Result<(), UnstableAbi> { ExternAbi::Custom => { Err(UnstableAbi { abi, feature: sym::abi_custom, explain: GateReason::Experimental }) } + ExternAbi::Swift => { + Err(UnstableAbi { abi, feature: sym::abi_swift, explain: GateReason::Experimental }) + } } } diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs index 5725c6551884..afaee6e54208 100644 --- a/compiler/rustc_ast_passes/src/ast_validation.rs +++ b/compiler/rustc_ast_passes/src/ast_validation.rs @@ -424,6 +424,7 @@ fn check_extern_fn_signature(&self, abi: ExternAbi, ctxt: FnCtxt, ident: &Ident, | CanonAbi::Rust | CanonAbi::RustCold | CanonAbi::RustPreserveNone + | CanonAbi::Swift | CanonAbi::Arm(_) | CanonAbi::X86(_) => { /* nothing to check */ } diff --git a/compiler/rustc_codegen_cranelift/src/abi/mod.rs b/compiler/rustc_codegen_cranelift/src/abi/mod.rs index 6a27b8172f98..a8b179f169bf 100644 --- a/compiler/rustc_codegen_cranelift/src/abi/mod.rs +++ b/compiler/rustc_codegen_cranelift/src/abi/mod.rs @@ -70,7 +70,7 @@ pub(crate) fn conv_to_call_conv( _ => default_call_conv, }, - CanonAbi::Interrupt(_) | CanonAbi::Arm(_) => { + CanonAbi::Interrupt(_) | CanonAbi::Arm(_) | CanonAbi::Swift => { sess.dcx().fatal("call conv {c:?} is not yet implemented") } CanonAbi::GpuKernel => { diff --git a/compiler/rustc_codegen_gcc/src/abi.rs b/compiler/rustc_codegen_gcc/src/abi.rs index 2f5c555b702a..7239a5bcb041 100644 --- a/compiler/rustc_codegen_gcc/src/abi.rs +++ b/compiler/rustc_codegen_gcc/src/abi.rs @@ -245,6 +245,8 @@ pub fn conv_to_fn_attribute<'gcc>(conv: CanonAbi, arch: &Arch) -> Option return None, + // gcc/gccjit does not have anything for Swift's calling convention. + CanonAbi::Swift => panic!("gcc/gccjit backend does not support Swift calling convention"), CanonAbi::Arm(arm_call) => match arm_call { ArmCall::CCmseNonSecureCall => FnAttribute::ArmCmseNonsecureCall, ArmCall::CCmseNonSecureEntry => FnAttribute::ArmCmseNonsecureEntry, diff --git a/compiler/rustc_codegen_llvm/src/abi.rs b/compiler/rustc_codegen_llvm/src/abi.rs index dcde960258a5..c3bf566b3588 100644 --- a/compiler/rustc_codegen_llvm/src/abi.rs +++ b/compiler/rustc_codegen_llvm/src/abi.rs @@ -722,6 +722,7 @@ pub(crate) fn to_llvm_calling_convention(sess: &Session, abi: CanonAbi) -> llvm: // possible to declare an `extern "custom"` block, so the backend still needs a calling // convention for declaring foreign functions. CanonAbi::Custom => llvm::CCallConv, + CanonAbi::Swift => llvm::SwiftCallConv, CanonAbi::GpuKernel => match &sess.target.arch { Arch::AmdGpu => llvm::AmdgpuKernel, Arch::Nvptx64 => llvm::PtxKernel, diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs index 9ecf5afcbcb3..ff566642c624 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs @@ -166,6 +166,7 @@ pub(crate) enum CallConv { ColdCallConv = 9, PreserveMost = 14, PreserveAll = 15, + SwiftCallConv = 16, Tail = 18, PreserveNone = 21, X86StdcallCallConv = 64, diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index 61354d7f3367..8385c320d377 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -380,6 +380,8 @@ pub fn internal(&self, feature: Symbol) -> bool { (unstable, abi_ptx, "1.15.0", Some(38788)), /// Allows `extern "riscv-interrupt-m" fn()` and `extern "riscv-interrupt-s" fn()`. (unstable, abi_riscv_interrupt, "1.73.0", Some(111889)), + /// Allows `extern "Swift" fn()`. + (unstable, abi_swift, "CURRENT_RUSTC_VERSION", Some(156481)), /// Allows `extern "x86-interrupt" fn()`. (unstable, abi_x86_interrupt, "1.17.0", Some(40180)), /// Allows additional const parameter types, such as `[u8; 10]` or user defined types diff --git a/compiler/rustc_hir_typeck/src/callee.rs b/compiler/rustc_hir_typeck/src/callee.rs index a564c57c3648..e15c9fe66164 100644 --- a/compiler/rustc_hir_typeck/src/callee.rs +++ b/compiler/rustc_hir_typeck/src/callee.rs @@ -202,6 +202,7 @@ pub(crate) fn check_call_abi(&self, abi: ExternAbi, span: Span) { | CanonAbi::Rust | CanonAbi::RustCold | CanonAbi::RustPreserveNone + | CanonAbi::Swift | CanonAbi::Arm(_) | CanonAbi::X86(_) => {} } diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs index 0c82452342fd..4fff5f1d1b64 100644 --- a/compiler/rustc_middle/src/ty/layout.rs +++ b/compiler/rustc_middle/src/ty/layout.rs @@ -1291,6 +1291,7 @@ pub fn fn_can_unwind(tcx: TyCtxt<'_>, fn_def_id: Option, abi: ExternAbi) | RiscvInterruptM | RiscvInterruptS | RustInvalid + | Swift | Unadjusted => false, Rust | RustCall | RustCold | RustPreserveNone => tcx.sess.panic_strategy().unwinds(), } diff --git a/compiler/rustc_public/src/abi.rs b/compiler/rustc_public/src/abi.rs index 4a780d652df8..1227fe23713c 100644 --- a/compiler/rustc_public/src/abi.rs +++ b/compiler/rustc_public/src/abi.rs @@ -458,6 +458,8 @@ pub enum CallConvention { Custom, + Swift, + // Target-specific calling conventions. ArmAapcs, CCmseNonSecureCall, diff --git a/compiler/rustc_public/src/ty.rs b/compiler/rustc_public/src/ty.rs index 59b4c6bee5c0..f71ca7213e9e 100644 --- a/compiler/rustc_public/src/ty.rs +++ b/compiler/rustc_public/src/ty.rs @@ -1169,6 +1169,7 @@ pub enum Abi { RustPreserveNone, RustInvalid, Custom, + Swift, } /// A binder represents a possibly generic type and its bound vars. diff --git a/compiler/rustc_public/src/unstable/convert/internal.rs b/compiler/rustc_public/src/unstable/convert/internal.rs index 165ad737fccb..37f00da9f710 100644 --- a/compiler/rustc_public/src/unstable/convert/internal.rs +++ b/compiler/rustc_public/src/unstable/convert/internal.rs @@ -619,6 +619,7 @@ fn internal<'tcx>( Abi::RiscvInterruptS => rustc_abi::ExternAbi::RiscvInterruptS, Abi::RustPreserveNone => rustc_abi::ExternAbi::RustPreserveNone, Abi::Custom => rustc_abi::ExternAbi::Custom, + Abi::Swift => rustc_abi::ExternAbi::Swift, } } } diff --git a/compiler/rustc_public/src/unstable/convert/stable/abi.rs b/compiler/rustc_public/src/unstable/convert/stable/abi.rs index 56fbd8108786..b98a9804ce8b 100644 --- a/compiler/rustc_public/src/unstable/convert/stable/abi.rs +++ b/compiler/rustc_public/src/unstable/convert/stable/abi.rs @@ -126,6 +126,7 @@ fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) CanonAbi::RustCold => CallConvention::Cold, CanonAbi::RustPreserveNone => CallConvention::PreserveNone, CanonAbi::Custom => CallConvention::Custom, + CanonAbi::Swift => CallConvention::Swift, CanonAbi::Arm(arm_call) => match arm_call { ArmCall::Aapcs => CallConvention::ArmAapcs, ArmCall::CCmseNonSecureCall => CallConvention::CCmseNonSecureCall, diff --git a/compiler/rustc_public/src/unstable/convert/stable/ty.rs b/compiler/rustc_public/src/unstable/convert/stable/ty.rs index 80453d838b88..c4f1da14da23 100644 --- a/compiler/rustc_public/src/unstable/convert/stable/ty.rs +++ b/compiler/rustc_public/src/unstable/convert/stable/ty.rs @@ -1050,6 +1050,7 @@ fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) ExternAbi::RiscvInterruptM => Abi::RiscvInterruptM, ExternAbi::RiscvInterruptS => Abi::RiscvInterruptS, ExternAbi::Custom => Abi::Custom, + ExternAbi::Swift => Abi::Swift, } } } diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 691051756792..69ed7314855f 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -355,6 +355,7 @@ abi_msp430_interrupt, abi_ptx, abi_riscv_interrupt, + abi_swift, abi_sysv64, abi_thiscall, abi_unadjusted, diff --git a/compiler/rustc_target/src/spec/abi_map.rs b/compiler/rustc_target/src/spec/abi_map.rs index c0fdd946778b..8c56dcb89971 100644 --- a/compiler/rustc_target/src/spec/abi_map.rs +++ b/compiler/rustc_target/src/spec/abi_map.rs @@ -65,7 +65,9 @@ pub fn from_target(target: &Target) -> Self { _ => ArchKind::Other, }; - let os = if target.is_like_windows { + let os = if target.is_like_darwin { + OsKind::Apple + } else if target.is_like_windows { OsKind::Windows } else if target.is_like_vexos { OsKind::VEXos @@ -80,6 +82,15 @@ pub fn from_target(target: &Target) -> Self { pub fn canonize_abi(&self, extern_abi: ExternAbi, has_c_varargs: bool) -> AbiMapping { let AbiMap { os, arch } = *self; + if extern_abi == ExternAbi::Swift { + // Per https://www.swift.org/blog/abi-stability-and-more/, Swift's ABI + // is only stable on Apple platforms, so we reject it elsewhere. + match os { + OsKind::Apple => {} + _ => return AbiMapping::Invalid, + } + } + let canon_abi = match (extern_abi, arch) { // infallible lowerings (ExternAbi::C { .. }, _) => CanonAbi::C, @@ -92,6 +103,8 @@ pub fn canonize_abi(&self, extern_abi: ExternAbi, has_c_varargs: bool) -> AbiMap (ExternAbi::Custom, _) => CanonAbi::Custom, + (ExternAbi::Swift, _) => CanonAbi::Swift, + (ExternAbi::System { .. }, ArchKind::X86) if os == OsKind::Windows && !has_c_varargs => { @@ -213,6 +226,7 @@ enum ArchKind { #[derive(Debug, PartialEq, Copy, Clone)] enum OsKind { + Apple, Windows, VEXos, Other, diff --git a/tests/ui/abi/swift-abi-non-apple.rs b/tests/ui/abi/swift-abi-non-apple.rs new file mode 100644 index 000000000000..a374f38c9c8e --- /dev/null +++ b/tests/ui/abi/swift-abi-non-apple.rs @@ -0,0 +1,33 @@ +//@ add-minicore +//@ needs-llvm-components: x86 +//@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=rlib +//@ ignore-backends: gcc +#![no_core] +#![feature(no_core, lang_items, abi_swift)] + +extern crate minicore; +use minicore::*; + +// The Swift ABI is only stable on Apple platforms, so it must be rejected +// on other targets even when the `abi_swift` feature gate is enabled. + +extern "Swift" fn f() {} //~ ERROR is not a supported ABI + +trait T { + extern "Swift" fn m(); //~ ERROR is not a supported ABI + + extern "Swift" fn dm() {} //~ ERROR is not a supported ABI +} + +struct S; +impl T for S { + extern "Swift" fn m() {} //~ ERROR is not a supported ABI +} + +impl S { + extern "Swift" fn im() {} //~ ERROR is not a supported ABI +} + +type TA = extern "Swift" fn(); //~ ERROR is not a supported ABI + +extern "Swift" {} //~ ERROR is not a supported ABI diff --git a/tests/ui/abi/swift-abi-non-apple.stderr b/tests/ui/abi/swift-abi-non-apple.stderr new file mode 100644 index 000000000000..7dae75c96d46 --- /dev/null +++ b/tests/ui/abi/swift-abi-non-apple.stderr @@ -0,0 +1,45 @@ +error[E0570]: "Swift" is not a supported ABI for the current target + --> $DIR/swift-abi-non-apple.rs:14:8 + | +LL | extern "Swift" fn f() {} + | ^^^^^^^ + +error[E0570]: "Swift" is not a supported ABI for the current target + --> $DIR/swift-abi-non-apple.rs:17:12 + | +LL | extern "Swift" fn m(); + | ^^^^^^^ + +error[E0570]: "Swift" is not a supported ABI for the current target + --> $DIR/swift-abi-non-apple.rs:19:12 + | +LL | extern "Swift" fn dm() {} + | ^^^^^^^ + +error[E0570]: "Swift" is not a supported ABI for the current target + --> $DIR/swift-abi-non-apple.rs:24:12 + | +LL | extern "Swift" fn m() {} + | ^^^^^^^ + +error[E0570]: "Swift" is not a supported ABI for the current target + --> $DIR/swift-abi-non-apple.rs:28:12 + | +LL | extern "Swift" fn im() {} + | ^^^^^^^ + +error[E0570]: "Swift" is not a supported ABI for the current target + --> $DIR/swift-abi-non-apple.rs:31:18 + | +LL | type TA = extern "Swift" fn(); + | ^^^^^^^ + +error[E0570]: "Swift" is not a supported ABI for the current target + --> $DIR/swift-abi-non-apple.rs:33:8 + | +LL | extern "Swift" {} + | ^^^^^^^ + +error: aborting due to 7 previous errors + +For more information about this error, try `rustc --explain E0570`. diff --git a/tests/ui/feature-gates/feature-gate-abi_swift.rs b/tests/ui/feature-gates/feature-gate-abi_swift.rs new file mode 100644 index 000000000000..dc78d4fa33bc --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-abi_swift.rs @@ -0,0 +1,33 @@ +//@ add-minicore +//@ needs-llvm-components: aarch64 +//@ compile-flags: --target=aarch64-apple-darwin --crate-type=rlib +//@ ignore-backends: gcc +#![no_core] +#![feature(no_core, lang_items)] + +extern crate minicore; +use minicore::*; + +// Test that the "Swift" ABI is feature-gated, and cannot be used when +// the `abi_swift` feature gate is not used. + +extern "Swift" fn f() {} //~ ERROR "Swift" ABI is experimental + +trait T { + extern "Swift" fn m(); //~ ERROR "Swift" ABI is experimental + + extern "Swift" fn dm() {} //~ ERROR "Swift" ABI is experimental +} + +struct S; +impl T for S { + extern "Swift" fn m() {} //~ ERROR "Swift" ABI is experimental +} + +impl S { + extern "Swift" fn im() {} //~ ERROR "Swift" ABI is experimental +} + +type TA = extern "Swift" fn(); //~ ERROR "Swift" ABI is experimental + +extern "Swift" {} //~ ERROR "Swift" ABI is experimental diff --git a/tests/ui/feature-gates/feature-gate-abi_swift.stderr b/tests/ui/feature-gates/feature-gate-abi_swift.stderr new file mode 100644 index 000000000000..0d839d95fe83 --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-abi_swift.stderr @@ -0,0 +1,73 @@ +error[E0658]: the extern "Swift" ABI is experimental and subject to change + --> $DIR/feature-gate-abi_swift.rs:14:8 + | +LL | extern "Swift" fn f() {} + | ^^^^^^^ + | + = note: see issue #156481 for more information + = help: add `#![feature(abi_swift)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: the extern "Swift" ABI is experimental and subject to change + --> $DIR/feature-gate-abi_swift.rs:17:12 + | +LL | extern "Swift" fn m(); + | ^^^^^^^ + | + = note: see issue #156481 for more information + = help: add `#![feature(abi_swift)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: the extern "Swift" ABI is experimental and subject to change + --> $DIR/feature-gate-abi_swift.rs:19:12 + | +LL | extern "Swift" fn dm() {} + | ^^^^^^^ + | + = note: see issue #156481 for more information + = help: add `#![feature(abi_swift)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: the extern "Swift" ABI is experimental and subject to change + --> $DIR/feature-gate-abi_swift.rs:24:12 + | +LL | extern "Swift" fn m() {} + | ^^^^^^^ + | + = note: see issue #156481 for more information + = help: add `#![feature(abi_swift)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: the extern "Swift" ABI is experimental and subject to change + --> $DIR/feature-gate-abi_swift.rs:28:12 + | +LL | extern "Swift" fn im() {} + | ^^^^^^^ + | + = note: see issue #156481 for more information + = help: add `#![feature(abi_swift)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: the extern "Swift" ABI is experimental and subject to change + --> $DIR/feature-gate-abi_swift.rs:31:18 + | +LL | type TA = extern "Swift" fn(); + | ^^^^^^^ + | + = note: see issue #156481 for more information + = help: add `#![feature(abi_swift)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: the extern "Swift" ABI is experimental and subject to change + --> $DIR/feature-gate-abi_swift.rs:33:8 + | +LL | extern "Swift" {} + | ^^^^^^^ + | + = note: see issue #156481 for more information + = help: add `#![feature(abi_swift)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error: aborting due to 7 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/print-request/print-calling-conventions.stdout b/tests/ui/print-request/print-calling-conventions.stdout index 8366697d0fb0..506bbea23e17 100644 --- a/tests/ui/print-request/print-calling-conventions.stdout +++ b/tests/ui/print-request/print-calling-conventions.stdout @@ -1,6 +1,7 @@ C C-unwind Rust +Swift aapcs aapcs-unwind avr-interrupt