@@ -4,14 +4,20 @@ error[E0045]: C-variadic functions with the "stdcall" calling convention are not
44LL | fn printf(_: *const u8, ...);
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
66
7+ error[E0045]: C-variadic functions with the "Rust" calling convention are not supported
8+ --> $DIR/variadic-ffi-1.rs:15:11
9+ |
10+ LL | fn baz(f: extern "Rust" fn(usize, ...)) {
11+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
12+
713error[E0060]: this function takes at least 2 arguments but 0 arguments were supplied
8- --> $DIR/variadic-ffi-1.rs:23 :9
14+ --> $DIR/variadic-ffi-1.rs:28 :9
915 |
1016LL | foo();
1117 | ^^^-- two arguments of type `isize` and `u8` are missing
1218 |
1319note: function defined here
14- --> $DIR/variadic-ffi-1.rs:16 :8
20+ --> $DIR/variadic-ffi-1.rs:21 :8
1521 |
1622LL | fn foo(f: isize, x: u8, ...);
1723 | ^^^ - -
@@ -21,13 +27,13 @@ LL | foo(/* isize */, /* u8 */);
2127 | +++++++++++++++++++++
2228
2329error[E0060]: this function takes at least 2 arguments but 1 argument was supplied
24- --> $DIR/variadic-ffi-1.rs:24 :9
30+ --> $DIR/variadic-ffi-1.rs:29 :9
2531 |
2632LL | foo(1);
2733 | ^^^--- argument #2 of type `u8` is missing
2834 |
2935note: function defined here
30- --> $DIR/variadic-ffi-1.rs:16 :8
36+ --> $DIR/variadic-ffi-1.rs:21 :8
3137 |
3238LL | fn foo(f: isize, x: u8, ...);
3339 | ^^^ -
@@ -37,7 +43,7 @@ LL | foo(1, /* u8 */);
3743 | ++++++++++
3844
3945error[E0308]: mismatched types
40- --> $DIR/variadic-ffi-1.rs:26 :56
46+ --> $DIR/variadic-ffi-1.rs:31 :56
4147 |
4248LL | let x: unsafe extern "C" fn(f: isize, x: u8) = foo;
4349 | ------------------------------------- ^^^ expected non-variadic fn, found variadic function
@@ -48,7 +54,7 @@ LL | let x: unsafe extern "C" fn(f: isize, x: u8) = foo;
4854 found fn item `unsafe extern "C" fn(_, _, ...) {foo}`
4955
5056error[E0308]: mismatched types
51- --> $DIR/variadic-ffi-1.rs:27 :54
57+ --> $DIR/variadic-ffi-1.rs:32 :54
5258 |
5359LL | let y: extern "C" fn(f: isize, x: u8, ...) = bar;
5460 | ----------------------------------- ^^^ expected variadic fn, found non-variadic function
@@ -59,7 +65,7 @@ LL | let y: extern "C" fn(f: isize, x: u8, ...) = bar;
5965 found fn item `extern "C" fn(_, _) {bar}`
6066
6167error[E0617]: can't pass `f32` to variadic function
62- --> $DIR/variadic-ffi-1.rs:29 :19
68+ --> $DIR/variadic-ffi-1.rs:34 :19
6369 |
6470LL | foo(1, 2, 3f32);
6571 | ^^^^
@@ -70,7 +76,7 @@ LL | foo(1, 2, 3f32 as c_double);
7076 | +++++++++++
7177
7278error[E0617]: can't pass `bool` to variadic function
73- --> $DIR/variadic-ffi-1.rs:30 :19
79+ --> $DIR/variadic-ffi-1.rs:35 :19
7480 |
7581LL | foo(1, 2, true);
7682 | ^^^^
@@ -81,7 +87,7 @@ LL | foo(1, 2, true as c_int);
8187 | ++++++++
8288
8389error[E0617]: can't pass `i8` to variadic function
84- --> $DIR/variadic-ffi-1.rs:31 :19
90+ --> $DIR/variadic-ffi-1.rs:36 :19
8591 |
8692LL | foo(1, 2, 1i8);
8793 | ^^^
@@ -92,7 +98,7 @@ LL | foo(1, 2, 1i8 as c_int);
9298 | ++++++++
9399
94100error[E0617]: can't pass `u8` to variadic function
95- --> $DIR/variadic-ffi-1.rs:32 :19
101+ --> $DIR/variadic-ffi-1.rs:37 :19
96102 |
97103LL | foo(1, 2, 1u8);
98104 | ^^^
@@ -103,7 +109,7 @@ LL | foo(1, 2, 1u8 as c_uint);
103109 | +++++++++
104110
105111error[E0617]: can't pass `i16` to variadic function
106- --> $DIR/variadic-ffi-1.rs:33 :19
112+ --> $DIR/variadic-ffi-1.rs:38 :19
107113 |
108114LL | foo(1, 2, 1i16);
109115 | ^^^^
@@ -114,7 +120,7 @@ LL | foo(1, 2, 1i16 as c_int);
114120 | ++++++++
115121
116122error[E0617]: can't pass `u16` to variadic function
117- --> $DIR/variadic-ffi-1.rs:34 :19
123+ --> $DIR/variadic-ffi-1.rs:39 :19
118124 |
119125LL | foo(1, 2, 1u16);
120126 | ^^^^
@@ -124,7 +130,7 @@ help: cast the value to `c_uint`
124130LL | foo(1, 2, 1u16 as c_uint);
125131 | +++++++++
126132
127- error: aborting due to 11 previous errors
133+ error: aborting due to 12 previous errors
128134
129135Some errors have detailed explanations: E0045, E0060, E0308, E0617.
130136For more information about an error, try `rustc --explain E0045`.
0 commit comments