Rollup merge of #145954 - RalfJung:syscall-c-variadics, r=jackh726

stabilize extern_system_varargs

Based on top of https://github.com/rust-lang/rust/pull/144066. This has been already FCP'd over there, but `@workingjubilee` has some concerns regarding "system" varargs specifically (IIUC).

Reference PR: https://github.com/rust-lang/reference/pull/2069.
This commit is contained in:
Stuart Cook 2025-11-16 20:30:53 +11:00 committed by GitHub
commit a528a58a19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 4 additions and 27 deletions

View file

@ -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,
}
}

View file

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

View file

@ -501,8 +501,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.

View file

@ -14,7 +14,6 @@
//@[arm32] needs-llvm-components: arm
#![crate_type = "lib"]
#![feature(no_core)]
#![feature(extern_system_varargs)]
#![no_core]
extern crate minicore;

View file

@ -1,7 +0,0 @@
fn system(f: extern "system" fn(usize, ...)) {
//~^ ERROR unstable
f(22, 44);
}
fn main() {}

View file

@ -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 <https://github.com/rust-lang/rust/issues/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`.