Skip to content

Commit 36a1678

Browse files
committed
test that the abi of c-variadic functions is checked in extern blocks
1 parent aa5832b commit 36a1678

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,19 @@ fn win(f: extern "win64" fn(usize, ...)) {
1313
f(22, 44);
1414
}
1515

16+
extern "efiapi" {
17+
fn extern_efiapi(...);
18+
//~^ ERROR using calling conventions other than `C` or `cdecl` for varargs functions is unstable [E0658]
19+
}
20+
21+
extern "sysv64" {
22+
fn extern_sysv64(...);
23+
//~^ ERROR using calling conventions other than `C` or `cdecl` for varargs functions is unstable [E0658]
24+
}
25+
26+
extern "win64" {
27+
fn extern_win64(...);
28+
//~^ ERROR using calling conventions other than `C` or `cdecl` for varargs functions is unstable [E0658]
29+
}
30+
1631
fn main() {}

tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.stderr

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,36 @@ LL | fn win(f: extern "win64" fn(usize, ...)) {
2828
= help: add `#![feature(extended_varargs_abi_support)]` to the crate attributes to enable
2929
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
3030

31-
error: aborting due to 3 previous errors
31+
error[E0658]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable
32+
--> $DIR/feature-gate-extended_varargs_abi_support.rs:17:5
33+
|
34+
LL | fn extern_efiapi(...);
35+
| ^^^^^^^^^^^^^^^^^^^^^^
36+
|
37+
= note: see issue #100189 <https://github.com/rust-lang/rust/issues/100189> for more information
38+
= help: add `#![feature(extended_varargs_abi_support)]` to the crate attributes to enable
39+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
40+
41+
error[E0658]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable
42+
--> $DIR/feature-gate-extended_varargs_abi_support.rs:22:5
43+
|
44+
LL | fn extern_sysv64(...);
45+
| ^^^^^^^^^^^^^^^^^^^^^^
46+
|
47+
= note: see issue #100189 <https://github.com/rust-lang/rust/issues/100189> for more information
48+
= help: add `#![feature(extended_varargs_abi_support)]` to the crate attributes to enable
49+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
50+
51+
error[E0658]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable
52+
--> $DIR/feature-gate-extended_varargs_abi_support.rs:27:5
53+
|
54+
LL | fn extern_win64(...);
55+
| ^^^^^^^^^^^^^^^^^^^^^
56+
|
57+
= note: see issue #100189 <https://github.com/rust-lang/rust/issues/100189> for more information
58+
= help: add `#![feature(extended_varargs_abi_support)]` to the crate attributes to enable
59+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
60+
61+
error: aborting due to 6 previous errors
3262

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

0 commit comments

Comments
 (0)