1- error[E0045]: C-variadic function must have C or cdecl calling convention
1+ error[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl`
22 --> $DIR/variadic-ffi-1.rs:9:5
33 |
44LL | fn printf(_: *const u8, ...);
5- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadics require C or cdecl calling convention
5+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
66
77error[E0060]: this function takes at least 2 arguments but 0 arguments were supplied
8- --> $DIR/variadic-ffi-1.rs:20 :9
8+ --> $DIR/variadic-ffi-1.rs:22 :9
99 |
1010LL | foo();
1111 | ^^^-- two arguments of type `isize` and `u8` are missing
1212 |
1313note: function defined here
14- --> $DIR/variadic-ffi-1.rs:13 :8
14+ --> $DIR/variadic-ffi-1.rs:15 :8
1515 |
1616LL | fn foo(f: isize, x: u8, ...);
1717 | ^^^
@@ -21,13 +21,13 @@ LL | foo(/* isize */, /* u8 */);
2121 | ~~~~~~~~~~~~~~~~~~~~~~~
2222
2323error[E0060]: this function takes at least 2 arguments but 1 argument was supplied
24- --> $DIR/variadic-ffi-1.rs:21 :9
24+ --> $DIR/variadic-ffi-1.rs:23 :9
2525 |
2626LL | foo(1);
2727 | ^^^--- an argument of type `u8` is missing
2828 |
2929note: function defined here
30- --> $DIR/variadic-ffi-1.rs:13 :8
30+ --> $DIR/variadic-ffi-1.rs:15 :8
3131 |
3232LL | fn foo(f: isize, x: u8, ...);
3333 | ^^^
@@ -37,7 +37,7 @@ LL | foo(1, /* u8 */);
3737 | ~~~~~~~~~~~~~
3838
3939error[E0308]: mismatched types
40- --> $DIR/variadic-ffi-1.rs:23 :56
40+ --> $DIR/variadic-ffi-1.rs:25 :56
4141 |
4242LL | let x: unsafe extern "C" fn(f: isize, x: u8) = foo;
4343 | ------------------------------------- ^^^ expected non-variadic fn, found variadic function
@@ -48,7 +48,7 @@ LL | let x: unsafe extern "C" fn(f: isize, x: u8) = foo;
4848 found fn item `unsafe extern "C" fn(_, _, ...) {foo}`
4949
5050error[E0308]: mismatched types
51- --> $DIR/variadic-ffi-1.rs:24 :54
51+ --> $DIR/variadic-ffi-1.rs:26 :54
5252 |
5353LL | let y: extern "C" fn(f: isize, x: u8, ...) = bar;
5454 | ----------------------------------- ^^^ expected variadic fn, found non-variadic function
@@ -59,37 +59,37 @@ LL | let y: extern "C" fn(f: isize, x: u8, ...) = bar;
5959 found fn item `extern "C" fn(_, _) {bar}`
6060
6161error[E0617]: can't pass `f32` to variadic function
62- --> $DIR/variadic-ffi-1.rs:26 :19
62+ --> $DIR/variadic-ffi-1.rs:28 :19
6363 |
6464LL | foo(1, 2, 3f32);
6565 | ^^^^ help: cast the value to `c_double`: `3f32 as c_double`
6666
6767error[E0617]: can't pass `bool` to variadic function
68- --> $DIR/variadic-ffi-1.rs:27 :19
68+ --> $DIR/variadic-ffi-1.rs:29 :19
6969 |
7070LL | foo(1, 2, true);
7171 | ^^^^ help: cast the value to `c_int`: `true as c_int`
7272
7373error[E0617]: can't pass `i8` to variadic function
74- --> $DIR/variadic-ffi-1.rs:28 :19
74+ --> $DIR/variadic-ffi-1.rs:30 :19
7575 |
7676LL | foo(1, 2, 1i8);
7777 | ^^^ help: cast the value to `c_int`: `1i8 as c_int`
7878
7979error[E0617]: can't pass `u8` to variadic function
80- --> $DIR/variadic-ffi-1.rs:29 :19
80+ --> $DIR/variadic-ffi-1.rs:31 :19
8181 |
8282LL | foo(1, 2, 1u8);
8383 | ^^^ help: cast the value to `c_uint`: `1u8 as c_uint`
8484
8585error[E0617]: can't pass `i16` to variadic function
86- --> $DIR/variadic-ffi-1.rs:30 :19
86+ --> $DIR/variadic-ffi-1.rs:32 :19
8787 |
8888LL | foo(1, 2, 1i16);
8989 | ^^^^ help: cast the value to `c_int`: `1i16 as c_int`
9090
9191error[E0617]: can't pass `u16` to variadic function
92- --> $DIR/variadic-ffi-1.rs:31 :19
92+ --> $DIR/variadic-ffi-1.rs:33 :19
9393 |
9494LL | foo(1, 2, 1u16);
9595 | ^^^^ help: cast the value to `c_uint`: `1u16 as c_uint`
0 commit comments