]> git.lizzy.rs Git - rust.git/blob - src/test/ui/variadic/variadic-ffi-3.stderr
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / 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:21:9
3    |
4 LL |     fn foo(f: isize, x: u8, ...);
5    |     ----------------------------- defined here
6 ...
7 LL |         foo(); //~ ERROR: this function takes at least 2 parameters but 0 parameters were supplied
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:22:9
12    |
13 LL |     fn foo(f: isize, x: u8, ...);
14    |     ----------------------------- defined here
15 ...
16 LL |         foo(1); //~ ERROR: this function takes at least 2 parameters but 1 parameter was supplied
17    |         ^^^^^^ expected at least 2 parameters
18
19 error[E0308]: mismatched types
20   --> $DIR/variadic-ffi-3.rs:24: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 `unsafe extern "C" fn(isize, u8, ...) {foo}`
27
28 error[E0308]: mismatched types
29   --> $DIR/variadic-ffi-3.rs:29: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 `extern "C" fn(isize, u8, ...)`
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:34:19
39    |
40 LL |         foo(1, 2, 3f32); //~ ERROR can't pass `f32` to variadic function
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:35:19
45    |
46 LL |         foo(1, 2, true); //~ ERROR can't pass `bool` to variadic function
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:36:19
51    |
52 LL |         foo(1, 2, 1i8); //~ ERROR can't pass `i8` to variadic function
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:37:19
57    |
58 LL |         foo(1, 2, 1u8); //~ ERROR can't pass `u8` to variadic function
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:38:19
63    |
64 LL |         foo(1, 2, 1i16); //~ ERROR can't pass `i16` to variadic function
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:39:19
69    |
70 LL |         foo(1, 2, 1u16); //~ ERROR can't pass `u16` to variadic function
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 occurred: E0060, E0308, E0617.
76 For more information about an error, try `rustc --explain E0060`.