1 error: `extern` fn uses type `[u32]`, which is not FFI-safe
2 --> $DIR/lint-ctypes-fn.rs:67:33
4 LL | pub extern "C" fn slice_type(p: &[u32]) { }
7 note: the lint level is defined here
8 --> $DIR/lint-ctypes-fn.rs:4:9
10 LL | #![deny(improper_ctypes_definitions)]
11 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 = help: consider using a raw pointer instead
13 = note: slices have no C equivalent
15 error: `extern` fn uses type `str`, which is not FFI-safe
16 --> $DIR/lint-ctypes-fn.rs:70:31
18 LL | pub extern "C" fn str_type(p: &str) { }
21 = help: consider using `*const u8` and a length instead
22 = note: string slices have no C equivalent
24 error: `extern` fn uses type `char`, which is not FFI-safe
25 --> $DIR/lint-ctypes-fn.rs:77:32
27 LL | pub extern "C" fn char_type(p: char) { }
30 = help: consider using `u32` or `libc::wchar_t` instead
31 = note: the `char` type has no C equivalent
33 error: `extern` fn uses type `i128`, which is not FFI-safe
34 --> $DIR/lint-ctypes-fn.rs:80:32
36 LL | pub extern "C" fn i128_type(p: i128) { }
39 = note: 128-bit integers don't currently have a known stable ABI
41 error: `extern` fn uses type `u128`, which is not FFI-safe
42 --> $DIR/lint-ctypes-fn.rs:83:32
44 LL | pub extern "C" fn u128_type(p: u128) { }
47 = note: 128-bit integers don't currently have a known stable ABI
49 error: `extern` fn uses type `(i32, i32)`, which is not FFI-safe
50 --> $DIR/lint-ctypes-fn.rs:86:33
52 LL | pub extern "C" fn tuple_type(p: (i32, i32)) { }
53 | ^^^^^^^^^^ not FFI-safe
55 = help: consider using a struct instead
56 = note: tuples have unspecified layout
58 error: `extern` fn uses type `(i32, i32)`, which is not FFI-safe
59 --> $DIR/lint-ctypes-fn.rs:89:34
61 LL | pub extern "C" fn tuple_type2(p: I32Pair) { }
62 | ^^^^^^^ not FFI-safe
64 = help: consider using a struct instead
65 = note: tuples have unspecified layout
67 error: `extern` fn uses type `ZeroSize`, which is not FFI-safe
68 --> $DIR/lint-ctypes-fn.rs:92:32
70 LL | pub extern "C" fn zero_size(p: ZeroSize) { }
71 | ^^^^^^^^ not FFI-safe
73 = help: consider adding a member to this struct
74 = note: this struct has no fields
75 note: the type is defined here
76 --> $DIR/lint-ctypes-fn.rs:26:1
78 LL | pub struct ZeroSize;
79 | ^^^^^^^^^^^^^^^^^^^^
81 error: `extern` fn uses type `ZeroSizeWithPhantomData`, which is not FFI-safe
82 --> $DIR/lint-ctypes-fn.rs:95:40
84 LL | pub extern "C" fn zero_size_phantom(p: ZeroSizeWithPhantomData) { }
85 | ^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
87 = note: composed only of `PhantomData`
88 note: the type is defined here
89 --> $DIR/lint-ctypes-fn.rs:61:1
91 LL | pub struct ZeroSizeWithPhantomData(PhantomData<i32>);
92 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
94 error: `extern` fn uses type `PhantomData<bool>`, which is not FFI-safe
95 --> $DIR/lint-ctypes-fn.rs:98:51
97 LL | pub extern "C" fn zero_size_phantom_toplevel() -> PhantomData<bool> {
98 | ^^^^^^^^^^^^^^^^^ not FFI-safe
100 = note: composed only of `PhantomData`
102 error: `extern` fn uses type `fn()`, which is not FFI-safe
103 --> $DIR/lint-ctypes-fn.rs:103:30
105 LL | pub extern "C" fn fn_type(p: RustFn) { }
106 | ^^^^^^ not FFI-safe
108 = help: consider using an `extern fn(...) -> ...` function pointer instead
109 = note: this function pointer has Rust-specific calling convention
111 error: `extern` fn uses type `fn()`, which is not FFI-safe
112 --> $DIR/lint-ctypes-fn.rs:106:31
114 LL | pub extern "C" fn fn_type2(p: fn()) { }
117 = help: consider using an `extern fn(...) -> ...` function pointer instead
118 = note: this function pointer has Rust-specific calling convention
120 error: `extern` fn uses type `i128`, which is not FFI-safe
121 --> $DIR/lint-ctypes-fn.rs:111:39
123 LL | pub extern "C" fn transparent_i128(p: TransparentI128) { }
124 | ^^^^^^^^^^^^^^^ not FFI-safe
126 = note: 128-bit integers don't currently have a known stable ABI
128 error: `extern` fn uses type `str`, which is not FFI-safe
129 --> $DIR/lint-ctypes-fn.rs:114:38
131 LL | pub extern "C" fn transparent_str(p: TransparentStr) { }
132 | ^^^^^^^^^^^^^^ not FFI-safe
134 = help: consider using `*const u8` and a length instead
135 = note: string slices have no C equivalent
137 error: `extern` fn uses type `PhantomData<bool>`, which is not FFI-safe
138 --> $DIR/lint-ctypes-fn.rs:160:43
140 LL | pub extern "C" fn unused_generic2<T>() -> PhantomData<bool> {
141 | ^^^^^^^^^^^^^^^^^ not FFI-safe
143 = note: composed only of `PhantomData`
145 error: `extern` fn uses type `Vec<T>`, which is not FFI-safe
146 --> $DIR/lint-ctypes-fn.rs:173:39
148 LL | pub extern "C" fn used_generic4<T>(x: Vec<T>) { }
149 | ^^^^^^ not FFI-safe
151 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
152 = note: this struct has unspecified layout
154 error: `extern` fn uses type `Vec<T>`, which is not FFI-safe
155 --> $DIR/lint-ctypes-fn.rs:176:41
157 LL | pub extern "C" fn used_generic5<T>() -> Vec<T> {
158 | ^^^^^^ not FFI-safe
160 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
161 = note: this struct has unspecified layout
163 error: aborting due to 17 previous errors