]> git.proxmox.com Git - rustc.git/blob - src/test/ui/c-variadic/variadic-ffi-1.stderr
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / c-variadic / variadic-ffi-1.stderr
1 error[E0045]: C-variadic function must have C or cdecl calling convention
2 --> $DIR/variadic-ffi-1.rs:9:5
3 |
4 LL | fn printf(_: *const u8, ...);
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadics require C or cdecl calling convention
6
7 error[E0060]: this function takes at least 2 arguments but 0 arguments were supplied
8 --> $DIR/variadic-ffi-1.rs:20:9
9 |
10 LL | foo();
11 | ^^^-- supplied 0 arguments
12 | |
13 | expected at least 2 arguments
14 |
15 note: function defined here
16 --> $DIR/variadic-ffi-1.rs:13:8
17 |
18 LL | fn foo(f: isize, x: u8, ...);
19 | ^^^
20
21 error[E0060]: this function takes at least 2 arguments but 1 argument was supplied
22 --> $DIR/variadic-ffi-1.rs:21:9
23 |
24 LL | foo(1);
25 | ^^^ - supplied 1 argument
26 | |
27 | expected at least 2 arguments
28 |
29 note: function defined here
30 --> $DIR/variadic-ffi-1.rs:13:8
31 |
32 LL | fn foo(f: isize, x: u8, ...);
33 | ^^^
34
35 error[E0308]: mismatched types
36 --> $DIR/variadic-ffi-1.rs:23:56
37 |
38 LL | let x: unsafe extern "C" fn(f: isize, x: u8) = foo;
39 | ------------------------------------- ^^^ expected non-variadic fn, found variadic function
40 | |
41 | expected due to this
42 |
43 = note: expected fn pointer `unsafe extern "C" fn(_, _)`
44 found fn item `unsafe extern "C" fn(_, _, ...) {foo}`
45
46 error[E0308]: mismatched types
47 --> $DIR/variadic-ffi-1.rs:24:54
48 |
49 LL | let y: extern "C" fn(f: isize, x: u8, ...) = bar;
50 | ----------------------------------- ^^^ expected variadic fn, found non-variadic function
51 | |
52 | expected due to this
53 |
54 = note: expected fn pointer `extern "C" fn(_, _, ...)`
55 found fn item `extern "C" fn(_, _) {bar}`
56
57 error[E0617]: can't pass `f32` to variadic function
58 --> $DIR/variadic-ffi-1.rs:26:19
59 |
60 LL | foo(1, 2, 3f32);
61 | ^^^^ help: cast the value to `c_double`: `3f32 as c_double`
62
63 error[E0617]: can't pass `bool` to variadic function
64 --> $DIR/variadic-ffi-1.rs:27:19
65 |
66 LL | foo(1, 2, true);
67 | ^^^^ help: cast the value to `c_int`: `true as c_int`
68
69 error[E0617]: can't pass `i8` to variadic function
70 --> $DIR/variadic-ffi-1.rs:28:19
71 |
72 LL | foo(1, 2, 1i8);
73 | ^^^ help: cast the value to `c_int`: `1i8 as c_int`
74
75 error[E0617]: can't pass `u8` to variadic function
76 --> $DIR/variadic-ffi-1.rs:29:19
77 |
78 LL | foo(1, 2, 1u8);
79 | ^^^ help: cast the value to `c_uint`: `1u8 as c_uint`
80
81 error[E0617]: can't pass `i16` to variadic function
82 --> $DIR/variadic-ffi-1.rs:30:19
83 |
84 LL | foo(1, 2, 1i16);
85 | ^^^^ help: cast the value to `c_int`: `1i16 as c_int`
86
87 error[E0617]: can't pass `u16` to variadic function
88 --> $DIR/variadic-ffi-1.rs:31:19
89 |
90 LL | foo(1, 2, 1u16);
91 | ^^^^ help: cast the value to `c_uint`: `1u16 as c_uint`
92
93 error: aborting due to 11 previous errors
94
95 Some errors have detailed explanations: E0045, E0060, E0308, E0617.
96 For more information about an error, try `rustc --explain E0045`.