Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test that the abi of c-variadic functions is checked in extern blocks
  • Loading branch information
folkertdev committed Jun 1, 2025
commit b9007f5e1d17bb0fe782dbe3548db5dfb5ddffa4
15 changes: 15 additions & 0 deletions tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,19 @@ fn win(f: extern "win64" fn(usize, ...)) {
f(22, 44);
}

extern "efiapi" {
fn extern_efiapi(...);
//~^ ERROR using calling conventions other than `C` or `cdecl` for varargs functions is unstable [E0658]
}

extern "sysv64" {
fn extern_sysv64(...);
//~^ ERROR using calling conventions other than `C` or `cdecl` for varargs functions is unstable [E0658]
}

extern "win64" {
fn extern_win64(...);
//~^ ERROR using calling conventions other than `C` or `cdecl` for varargs functions is unstable [E0658]
}

fn main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,36 @@ LL | fn win(f: extern "win64" fn(usize, ...)) {
= help: add `#![feature(extended_varargs_abi_support)]` 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 3 previous errors
error[E0658]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable
--> $DIR/feature-gate-extended_varargs_abi_support.rs:17:5
|
LL | fn extern_efiapi(...);
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #100189 <https://github.com/rust-lang/rust/issues/100189> for more information
= help: add `#![feature(extended_varargs_abi_support)]` 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]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable
--> $DIR/feature-gate-extended_varargs_abi_support.rs:22:5
|
LL | fn extern_sysv64(...);
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #100189 <https://github.com/rust-lang/rust/issues/100189> for more information
= help: add `#![feature(extended_varargs_abi_support)]` 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]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable
--> $DIR/feature-gate-extended_varargs_abi_support.rs:27:5
|
LL | fn extern_win64(...);
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #100189 <https://github.com/rust-lang/rust/issues/100189> for more information
= help: add `#![feature(extended_varargs_abi_support)]` 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 6 previous errors

For more information about this error, try `rustc --explain E0658`.