]> git.lizzy.rs Git - rust.git/blob - src/test/ui/c-variadic/variadic-ffi-3.stderr
287622525722f0de0f387daedafd21b5eddd20ee
[rust.git] / src / test / ui / c-variadic / variadic-ffi-3.stderr
1 error[E0060]: this function takes at least 2 parameters but 0 parameters were supplied
2   --> $DIR/variadic-ffi-3.rs:11:9
3    |
4 LL |     fn foo(f: isize, x: u8, ...);
5    |     ----------------------------- defined here
6 ...
7 LL |         foo();
8    |         ^^^^^ expected at least 2 parameters
9
10 error[E0060]: this function takes at least 2 parameters but 1 parameter was supplied
11   --> $DIR/variadic-ffi-3.rs:12:9
12    |
13 LL |     fn foo(f: isize, x: u8, ...);
14    |     ----------------------------- defined here
15 ...
16 LL |         foo(1);
17    |         ^^^^^^ expected at least 2 parameters
18
19 error[E0308]: mismatched types
20   --> $DIR/variadic-ffi-3.rs:14:56
21    |
22 LL |         let x: unsafe extern "C" fn(f: isize, x: u8) = foo;
23    |                                                        ^^^ expected non-variadic fn, found variadic function
24    |
25    = note: expected type `unsafe extern "C" fn(isize, u8)`
26               found type `for<'r> unsafe extern "C" fn(isize, u8, std::ffi::VaList<'r>, ...) {foo}`
27
28 error[E0308]: mismatched types
29   --> $DIR/variadic-ffi-3.rs:18:54
30    |
31 LL |         let y: extern "C" fn(f: isize, x: u8, ...) = bar;
32    |                                                      ^^^ expected variadic fn, found non-variadic function
33    |
34    = note: expected type `for<'r> extern "C" fn(isize, u8, std::ffi::VaList<'r>, ...)`
35               found type `extern "C" fn(isize, u8) {bar}`
36
37 error[E0617]: can't pass `f32` to variadic function
38   --> $DIR/variadic-ffi-3.rs:22:19
39    |
40 LL |         foo(1, 2, 3f32);
41    |                   ^^^^ help: cast the value to `c_double`: `3f32 as c_double`
42
43 error[E0617]: can't pass `bool` to variadic function
44   --> $DIR/variadic-ffi-3.rs:23:19
45    |
46 LL |         foo(1, 2, true);
47    |                   ^^^^ help: cast the value to `c_int`: `true as c_int`
48
49 error[E0617]: can't pass `i8` to variadic function
50   --> $DIR/variadic-ffi-3.rs:24:19
51    |
52 LL |         foo(1, 2, 1i8);
53    |                   ^^^ help: cast the value to `c_int`: `1i8 as c_int`
54
55 error[E0617]: can't pass `u8` to variadic function
56   --> $DIR/variadic-ffi-3.rs:25:19
57    |
58 LL |         foo(1, 2, 1u8);
59    |                   ^^^ help: cast the value to `c_uint`: `1u8 as c_uint`
60
61 error[E0617]: can't pass `i16` to variadic function
62   --> $DIR/variadic-ffi-3.rs:26:19
63    |
64 LL |         foo(1, 2, 1i16);
65    |                   ^^^^ help: cast the value to `c_int`: `1i16 as c_int`
66
67 error[E0617]: can't pass `u16` to variadic function
68   --> $DIR/variadic-ffi-3.rs:27:19
69    |
70 LL |         foo(1, 2, 1u16);
71    |                   ^^^^ help: cast the value to `c_uint`: `1u16 as c_uint`
72
73 error: aborting due to 10 previous errors
74
75 Some errors have detailed explanations: E0060, E0308, E0617.
76 For more information about an error, try `rustc --explain E0060`.