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`
2
2
--> $DIR/variadic-ffi-1.rs:9:5
3
3
|
4
4
LL | fn printf(_: *const u8, ...);
5
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadics require C or cdecl calling convention
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
6
6
7
7
error[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
9
9
|
10
10
LL | foo();
11
11
| ^^^-- two arguments of type `isize` and `u8` are missing
12
12
|
13
13
note: function defined here
14
- --> $DIR/variadic-ffi-1.rs:13 :8
14
+ --> $DIR/variadic-ffi-1.rs:15 :8
15
15
|
16
16
LL | fn foo(f: isize, x: u8, ...);
17
17
| ^^^
@@ -21,13 +21,13 @@ LL | foo(/* isize */, /* u8 */);
21
21
| ~~~~~~~~~~~~~~~~~~~~~~~
22
22
23
23
error[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
25
25
|
26
26
LL | foo(1);
27
27
| ^^^--- an argument of type `u8` is missing
28
28
|
29
29
note: function defined here
30
- --> $DIR/variadic-ffi-1.rs:13 :8
30
+ --> $DIR/variadic-ffi-1.rs:15 :8
31
31
|
32
32
LL | fn foo(f: isize, x: u8, ...);
33
33
| ^^^
@@ -37,7 +37,7 @@ LL | foo(1, /* u8 */);
37
37
| ~~~~~~~~~~~~~
38
38
39
39
error[E0308]: mismatched types
40
- --> $DIR/variadic-ffi-1.rs:23 :56
40
+ --> $DIR/variadic-ffi-1.rs:25 :56
41
41
|
42
42
LL | let x: unsafe extern "C" fn(f: isize, x: u8) = foo;
43
43
| ------------------------------------- ^^^ expected non-variadic fn, found variadic function
@@ -48,7 +48,7 @@ LL | let x: unsafe extern "C" fn(f: isize, x: u8) = foo;
48
48
found fn item `unsafe extern "C" fn(_, _, ...) {foo}`
49
49
50
50
error[E0308]: mismatched types
51
- --> $DIR/variadic-ffi-1.rs:24 :54
51
+ --> $DIR/variadic-ffi-1.rs:26 :54
52
52
|
53
53
LL | let y: extern "C" fn(f: isize, x: u8, ...) = bar;
54
54
| ----------------------------------- ^^^ expected variadic fn, found non-variadic function
@@ -59,37 +59,37 @@ LL | let y: extern "C" fn(f: isize, x: u8, ...) = bar;
59
59
found fn item `extern "C" fn(_, _) {bar}`
60
60
61
61
error[E0617]: can't pass `f32` to variadic function
62
- --> $DIR/variadic-ffi-1.rs:26 :19
62
+ --> $DIR/variadic-ffi-1.rs:28 :19
63
63
|
64
64
LL | foo(1, 2, 3f32);
65
65
| ^^^^ help: cast the value to `c_double`: `3f32 as c_double`
66
66
67
67
error[E0617]: can't pass `bool` to variadic function
68
- --> $DIR/variadic-ffi-1.rs:27 :19
68
+ --> $DIR/variadic-ffi-1.rs:29 :19
69
69
|
70
70
LL | foo(1, 2, true);
71
71
| ^^^^ help: cast the value to `c_int`: `true as c_int`
72
72
73
73
error[E0617]: can't pass `i8` to variadic function
74
- --> $DIR/variadic-ffi-1.rs:28 :19
74
+ --> $DIR/variadic-ffi-1.rs:30 :19
75
75
|
76
76
LL | foo(1, 2, 1i8);
77
77
| ^^^ help: cast the value to `c_int`: `1i8 as c_int`
78
78
79
79
error[E0617]: can't pass `u8` to variadic function
80
- --> $DIR/variadic-ffi-1.rs:29 :19
80
+ --> $DIR/variadic-ffi-1.rs:31 :19
81
81
|
82
82
LL | foo(1, 2, 1u8);
83
83
| ^^^ help: cast the value to `c_uint`: `1u8 as c_uint`
84
84
85
85
error[E0617]: can't pass `i16` to variadic function
86
- --> $DIR/variadic-ffi-1.rs:30 :19
86
+ --> $DIR/variadic-ffi-1.rs:32 :19
87
87
|
88
88
LL | foo(1, 2, 1i16);
89
89
| ^^^^ help: cast the value to `c_int`: `1i16 as c_int`
90
90
91
91
error[E0617]: can't pass `u16` to variadic function
92
- --> $DIR/variadic-ffi-1.rs:31 :19
92
+ --> $DIR/variadic-ffi-1.rs:33 :19
93
93
|
94
94
LL | foo(1, 2, 1u16);
95
95
| ^^^^ help: cast the value to `c_uint`: `1u16 as c_uint`
0 commit comments