1 error: `extern` block uses type `Foo`, which is not FFI-safe
2 --> $DIR/lint-ctypes.rs:46:28
4 LL | pub fn ptr_type1(size: *const Foo);
5 | ^^^^^^^^^^ not FFI-safe
7 note: the lint level is defined here
8 --> $DIR/lint-ctypes.rs:4:9
10 LL | #![deny(improper_ctypes)]
12 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
13 = note: this struct has unspecified layout
14 note: the type is defined here
15 --> $DIR/lint-ctypes.rs:24:1
20 error: `extern` block uses type `Foo`, which is not FFI-safe
21 --> $DIR/lint-ctypes.rs:47:28
23 LL | pub fn ptr_type2(size: *const Foo);
24 | ^^^^^^^^^^ not FFI-safe
26 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
27 = note: this struct has unspecified layout
28 note: the type is defined here
29 --> $DIR/lint-ctypes.rs:24:1
34 error: `extern` block uses type `[u32]`, which is not FFI-safe
35 --> $DIR/lint-ctypes.rs:48:26
37 LL | pub fn slice_type(p: &[u32]);
40 = help: consider using a raw pointer instead
41 = note: slices have no C equivalent
43 error: `extern` block uses type `str`, which is not FFI-safe
44 --> $DIR/lint-ctypes.rs:49:24
46 LL | pub fn str_type(p: &str);
49 = help: consider using `*const u8` and a length instead
50 = note: string slices have no C equivalent
52 error: `extern` block uses type `std::boxed::Box<u32>`, which is not FFI-safe
53 --> $DIR/lint-ctypes.rs:50:24
55 LL | pub fn box_type(p: Box<u32>);
56 | ^^^^^^^^ not FFI-safe
58 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
59 = note: this struct has unspecified layout
61 error: `extern` block uses type `char`, which is not FFI-safe
62 --> $DIR/lint-ctypes.rs:51:25
64 LL | pub fn char_type(p: char);
67 = help: consider using `u32` or `libc::wchar_t` instead
68 = note: the `char` type has no C equivalent
70 error: `extern` block uses type `i128`, which is not FFI-safe
71 --> $DIR/lint-ctypes.rs:52:25
73 LL | pub fn i128_type(p: i128);
76 = note: 128-bit integers don't currently have a known stable ABI
78 error: `extern` block uses type `u128`, which is not FFI-safe
79 --> $DIR/lint-ctypes.rs:53:25
81 LL | pub fn u128_type(p: u128);
84 = note: 128-bit integers don't currently have a known stable ABI
86 error: `extern` block uses type `dyn std::clone::Clone`, which is not FFI-safe
87 --> $DIR/lint-ctypes.rs:54:26
89 LL | pub fn trait_type(p: &dyn Clone);
90 | ^^^^^^^^^^ not FFI-safe
92 = note: trait objects have no C equivalent
94 error: `extern` block uses type `(i32, i32)`, which is not FFI-safe
95 --> $DIR/lint-ctypes.rs:55:26
97 LL | pub fn tuple_type(p: (i32, i32));
98 | ^^^^^^^^^^ not FFI-safe
100 = help: consider using a struct instead
101 = note: tuples have unspecified layout
103 error: `extern` block uses type `(i32, i32)`, which is not FFI-safe
104 --> $DIR/lint-ctypes.rs:56:27
106 LL | pub fn tuple_type2(p: I32Pair);
107 | ^^^^^^^ not FFI-safe
109 = help: consider using a struct instead
110 = note: tuples have unspecified layout
112 error: `extern` block uses type `ZeroSize`, which is not FFI-safe
113 --> $DIR/lint-ctypes.rs:57:25
115 LL | pub fn zero_size(p: ZeroSize);
116 | ^^^^^^^^ not FFI-safe
118 = help: consider adding a member to this struct
119 = note: this struct has no fields
120 note: the type is defined here
121 --> $DIR/lint-ctypes.rs:20:1
123 LL | pub struct ZeroSize;
124 | ^^^^^^^^^^^^^^^^^^^^
126 error: `extern` block uses type `ZeroSizeWithPhantomData`, which is not FFI-safe
127 --> $DIR/lint-ctypes.rs:58:33
129 LL | pub fn zero_size_phantom(p: ZeroSizeWithPhantomData);
130 | ^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
132 = note: composed only of `PhantomData`
133 note: the type is defined here
134 --> $DIR/lint-ctypes.rs:43:1
136 LL | pub struct ZeroSizeWithPhantomData(::std::marker::PhantomData<i32>);
137 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
139 error: `extern` block uses type `std::marker::PhantomData<bool>`, which is not FFI-safe
140 --> $DIR/lint-ctypes.rs:61:12
142 LL | -> ::std::marker::PhantomData<bool>;
143 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
145 = note: composed only of `PhantomData`
147 error: `extern` block uses type `fn()`, which is not FFI-safe
148 --> $DIR/lint-ctypes.rs:62:23
150 LL | pub fn fn_type(p: RustFn);
151 | ^^^^^^ not FFI-safe
153 = help: consider using an `extern fn(...) -> ...` function pointer instead
154 = note: this function pointer has Rust-specific calling convention
156 error: `extern` block uses type `fn()`, which is not FFI-safe
157 --> $DIR/lint-ctypes.rs:63:24
159 LL | pub fn fn_type2(p: fn());
162 = help: consider using an `extern fn(...) -> ...` function pointer instead
163 = note: this function pointer has Rust-specific calling convention
165 error: `extern` block uses type `std::boxed::Box<u32>`, which is not FFI-safe
166 --> $DIR/lint-ctypes.rs:64:28
168 LL | pub fn fn_contained(p: RustBadRet);
169 | ^^^^^^^^^^ not FFI-safe
171 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
172 = note: this struct has unspecified layout
174 error: `extern` block uses type `i128`, which is not FFI-safe
175 --> $DIR/lint-ctypes.rs:65:32
177 LL | pub fn transparent_i128(p: TransparentI128);
178 | ^^^^^^^^^^^^^^^ not FFI-safe
180 = note: 128-bit integers don't currently have a known stable ABI
182 error: `extern` block uses type `str`, which is not FFI-safe
183 --> $DIR/lint-ctypes.rs:66:31
185 LL | pub fn transparent_str(p: TransparentStr);
186 | ^^^^^^^^^^^^^^ not FFI-safe
188 = help: consider using `*const u8` and a length instead
189 = note: string slices have no C equivalent
191 error: `extern` block uses type `std::boxed::Box<u32>`, which is not FFI-safe
192 --> $DIR/lint-ctypes.rs:67:30
194 LL | pub fn transparent_fn(p: TransparentBadFn);
195 | ^^^^^^^^^^^^^^^^ not FFI-safe
197 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
198 = note: this struct has unspecified layout
200 error: `extern` block uses type `[u8; 8]`, which is not FFI-safe
201 --> $DIR/lint-ctypes.rs:68:27
203 LL | pub fn raw_array(arr: [u8; 8]);
204 | ^^^^^^^ not FFI-safe
206 = help: consider passing a pointer to the array
207 = note: passing raw arrays by value is not FFI-safe
209 error: `extern` block uses type `u128`, which is not FFI-safe
210 --> $DIR/lint-ctypes.rs:70:34
212 LL | pub static static_u128_type: u128;
215 = note: 128-bit integers don't currently have a known stable ABI
217 error: `extern` block uses type `u128`, which is not FFI-safe
218 --> $DIR/lint-ctypes.rs:71:40
220 LL | pub static static_u128_array_type: [u128; 16];
221 | ^^^^^^^^^^ not FFI-safe
223 = note: 128-bit integers don't currently have a known stable ABI
225 error: aborting due to 23 previous errors