]> git.lizzy.rs Git - rust.git/blob - src/test/ui/error-codes/E0617.rs
Ensure `record_layout_for_printing()` is inlined.
[rust.git] / src / test / ui / error-codes / E0617.rs
1 // ignore-tidy-linelength
2
3 extern {
4     fn printf(c: *const i8, ...);
5 }
6
7 fn main() {
8     unsafe {
9         printf(::std::ptr::null(), 0f32);
10         //~^ ERROR can't pass `f32` to variadic function
11         //~| HELP cast the value to `c_double`
12         printf(::std::ptr::null(), 0i8);
13         //~^ ERROR can't pass `i8` to variadic function
14         //~| HELP cast the value to `c_int`
15         printf(::std::ptr::null(), 0i16);
16         //~^ ERROR can't pass `i16` to variadic function
17         //~| HELP cast the value to `c_int`
18         printf(::std::ptr::null(), 0u8);
19         //~^ ERROR can't pass `u8` to variadic function
20         //~| HELP cast the value to `c_uint`
21         printf(::std::ptr::null(), 0u16);
22         //~^ ERROR can't pass `u16` to variadic function
23         //~| HELP cast the value to `c_uint`
24         printf(::std::ptr::null(), printf);
25         //~^ ERROR can't pass `unsafe extern "C" fn(*const i8, ...) {printf}` to variadic function
26         //~| HELP cast the value to `unsafe extern "C" fn(*const i8, ...)`
27     }
28 }