Change variadic-ffi-2 to use a platform independant ABI

Otherwise this test will include a future incompatibility warning
on some targets but not others.
This commit is contained in:
Tamme Dittrich 2025-02-18 15:00:26 +01:00
parent 2bf5cc93e6
commit 310f837fd5
2 changed files with 4 additions and 17 deletions

View file

@ -1,9 +1,6 @@
//@ ignore-arm stdcall isn't supported
//@ ignore-x86 stdcall isn't supported
#![feature(extended_varargs_abi_support)]
#[allow(unsupported_fn_ptr_calling_conventions)]
fn baz(f: extern "stdcall" fn(usize, ...)) {
fn baz(f: extern "Rust" fn(usize, ...)) {
//~^ ERROR: C-variadic function must have a compatible calling convention,
// like C, cdecl, system, aapcs, win64, sysv64 or efiapi
f(22, 44);

View file

@ -1,19 +1,9 @@
error[E0045]: C-variadic function must have a compatible calling convention, like `C`, `cdecl`, `system`, `aapcs`, `win64`, `sysv64` or `efiapi`
--> $DIR/variadic-ffi-2.rs:6:11
--> $DIR/variadic-ffi-2.rs:3:11
|
LL | fn baz(f: extern "stdcall" fn(usize, ...)) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
LL | fn baz(f: extern "Rust" fn(usize, ...)) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0045`.
Future incompatibility report: Future breakage diagnostic:
warning: the calling convention "stdcall" is not supported on this target
--> $DIR/variadic-ffi-2.rs:6:11
|
LL | fn baz(f: extern "stdcall" fn(usize, ...)) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>