From b2b4397fab5c45d2ddd18ff51d0242ee520f409c Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 28 Aug 2025 12:06:09 +0200 Subject: [PATCH] stabilize extern_system_varargs --- compiler/rustc_abi/src/extern_abi.rs | 6 ++---- compiler/rustc_feature/src/accepted.rs | 2 ++ compiler/rustc_feature/src/unstable.rs | 2 -- tests/codegen-llvm/cffi/c-variadic-ffi.rs | 1 - .../feature-gate-extern_system_varargs.rs | 7 ------- .../feature-gate-extern_system_varargs.stderr | 13 ------------- 6 files changed, 4 insertions(+), 27 deletions(-) delete mode 100644 tests/ui/feature-gates/feature-gate-extern_system_varargs.rs delete mode 100644 tests/ui/feature-gates/feature-gate-extern_system_varargs.stderr diff --git a/compiler/rustc_abi/src/extern_abi.rs b/compiler/rustc_abi/src/extern_abi.rs index e3b2b1eff72d4..b23f347d691a8 100644 --- a/compiler/rustc_abi/src/extern_abi.rs +++ b/compiler/rustc_abi/src/extern_abi.rs @@ -269,10 +269,8 @@ impl ExternAbi { | Self::Aapcs { .. } | Self::Win64 { .. } | Self::SysV64 { .. } - | Self::EfiApi => CVariadicStatus::Stable, - Self::System { .. } => { - CVariadicStatus::Unstable { feature: rustc_span::sym::extern_system_varargs } - } + | Self::EfiApi + | Self::System { .. } => CVariadicStatus::Stable, _ => CVariadicStatus::NotSupported, } } diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index 6af4cfb0e562e..ddfab9be6ed8a 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -215,6 +215,8 @@ declare_features! ( (accepted, extern_crate_self, "1.34.0", Some(56409)), /// Allows access to crate names passed via `--extern` through prelude. (accepted, extern_prelude, "1.30.0", Some(44660)), + /// Allows using `system` as a calling convention with varargs. + (accepted, extern_system_varargs, "CURRENT_RUSTC_VERSION", Some(136946)), /// Allows using F16C intrinsics from `core::arch::{x86, x86_64}`. (accepted, f16c_target_feature, "1.68.0", Some(44839)), /// Allows field shorthands (`x` meaning `x: x`) in struct literal expressions. diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index 573e9aab0554a..07a137632962e 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -492,8 +492,6 @@ declare_features! ( (incomplete, explicit_tail_calls, "1.72.0", Some(112788)), /// Allows using `#[export_stable]` which indicates that an item is exportable. (incomplete, export_stable, "1.88.0", Some(139939)), - /// Allows using `system` as a calling convention with varargs. - (unstable, extern_system_varargs, "1.86.0", Some(136946)), /// Allows defining `extern type`s. (unstable, extern_types, "1.23.0", Some(43467)), /// Allow using 128-bit (quad precision) floating point numbers. diff --git a/tests/codegen-llvm/cffi/c-variadic-ffi.rs b/tests/codegen-llvm/cffi/c-variadic-ffi.rs index 1dee477e9ed7c..33220af4537c6 100644 --- a/tests/codegen-llvm/cffi/c-variadic-ffi.rs +++ b/tests/codegen-llvm/cffi/c-variadic-ffi.rs @@ -14,7 +14,6 @@ //@[arm32] needs-llvm-components: arm #![crate_type = "lib"] #![feature(no_core)] -#![feature(extern_system_varargs)] #![no_core] extern crate minicore; diff --git a/tests/ui/feature-gates/feature-gate-extern_system_varargs.rs b/tests/ui/feature-gates/feature-gate-extern_system_varargs.rs deleted file mode 100644 index 2206776cccac1..0000000000000 --- a/tests/ui/feature-gates/feature-gate-extern_system_varargs.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn system(f: extern "system" fn(usize, ...)) { - //~^ ERROR unstable - - f(22, 44); -} - -fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-extern_system_varargs.stderr b/tests/ui/feature-gates/feature-gate-extern_system_varargs.stderr deleted file mode 100644 index 1209275f719c0..0000000000000 --- a/tests/ui/feature-gates/feature-gate-extern_system_varargs.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0658]: C-variadic functions with the "system" calling convention are unstable - --> $DIR/feature-gate-extern_system_varargs.rs:1:14 - | -LL | fn system(f: extern "system" fn(usize, ...)) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #136946 for more information - = help: add `#![feature(extern_system_varargs)]` 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 1 previous error - -For more information about this error, try `rustc --explain E0658`.