1- error: `extern` fn uses type `Foo `, which is not FFI-safe
2- --> $DIR/lint-ctypes-fn.rs:63:35
1+ error: `extern` fn uses type `[u32] `, which is not FFI-safe
2+ --> $DIR/lint-ctypes-fn.rs:67:33
33 |
4- LL | pub extern "C" fn ptr_type1(size: *const Foo ) { }
5- | ^^^^ ^^^^^^ not FFI-safe
4+ LL | pub extern "C" fn slice_type(p: &[u32] ) { }
5+ | ^^^^^^ not FFI-safe
66 |
77note: the lint level is defined here
88 --> $DIR/lint-ctypes-fn.rs:4:9
99 |
1010LL | #![deny(improper_ctypes_definitions)]
1111 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
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-fn.rs:34:1
16- |
17- LL | pub struct Foo;
18- | ^^^^^^^^^^^^^^^
19-
20- error: `extern` fn uses type `Foo`, which is not FFI-safe
21- --> $DIR/lint-ctypes-fn.rs:66:35
22- |
23- LL | pub extern "C" fn ptr_type2(size: *const Foo) { }
24- | ^^^^^^^^^^ not FFI-safe
25- |
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-fn.rs:34:1
30- |
31- LL | pub struct Foo;
32- | ^^^^^^^^^^^^^^^
33-
34- error: `extern` fn uses type `[u32]`, which is not FFI-safe
35- --> $DIR/lint-ctypes-fn.rs:69:33
36- |
37- LL | pub extern "C" fn slice_type(p: &[u32]) { }
38- | ^^^^^^ not FFI-safe
39- |
4012 = help: consider using a raw pointer instead
4113 = note: slices have no C equivalent
4214
4315error: `extern` fn uses type `str`, which is not FFI-safe
44- --> $DIR/lint-ctypes-fn.rs:72 :31
16+ --> $DIR/lint-ctypes-fn.rs:70 :31
4517 |
4618LL | pub extern "C" fn str_type(p: &str) { }
4719 | ^^^^ not FFI-safe
@@ -50,7 +22,7 @@ LL | pub extern "C" fn str_type(p: &str) { }
5022 = note: string slices have no C equivalent
5123
5224error: `extern` fn uses type `std::boxed::Box<u32>`, which is not FFI-safe
53- --> $DIR/lint-ctypes-fn.rs:75 :31
25+ --> $DIR/lint-ctypes-fn.rs:73 :31
5426 |
5527LL | pub extern "C" fn box_type(p: Box<u32>) { }
5628 | ^^^^^^^^ not FFI-safe
@@ -59,7 +31,7 @@ LL | pub extern "C" fn box_type(p: Box<u32>) { }
5931 = note: this struct has unspecified layout
6032
6133error: `extern` fn uses type `char`, which is not FFI-safe
62- --> $DIR/lint-ctypes-fn.rs:78 :32
34+ --> $DIR/lint-ctypes-fn.rs:76 :32
6335 |
6436LL | pub extern "C" fn char_type(p: char) { }
6537 | ^^^^ not FFI-safe
@@ -68,23 +40,23 @@ LL | pub extern "C" fn char_type(p: char) { }
6840 = note: the `char` type has no C equivalent
6941
7042error: `extern` fn uses type `i128`, which is not FFI-safe
71- --> $DIR/lint-ctypes-fn.rs:81 :32
43+ --> $DIR/lint-ctypes-fn.rs:79 :32
7244 |
7345LL | pub extern "C" fn i128_type(p: i128) { }
7446 | ^^^^ not FFI-safe
7547 |
7648 = note: 128-bit integers don't currently have a known stable ABI
7749
7850error: `extern` fn uses type `u128`, which is not FFI-safe
79- --> $DIR/lint-ctypes-fn.rs:84 :32
51+ --> $DIR/lint-ctypes-fn.rs:82 :32
8052 |
8153LL | pub extern "C" fn u128_type(p: u128) { }
8254 | ^^^^ not FFI-safe
8355 |
8456 = note: 128-bit integers don't currently have a known stable ABI
8557
8658error: `extern` fn uses type `(i32, i32)`, which is not FFI-safe
87- --> $DIR/lint-ctypes-fn.rs:87 :33
59+ --> $DIR/lint-ctypes-fn.rs:85 :33
8860 |
8961LL | pub extern "C" fn tuple_type(p: (i32, i32)) { }
9062 | ^^^^^^^^^^ not FFI-safe
@@ -93,7 +65,7 @@ LL | pub extern "C" fn tuple_type(p: (i32, i32)) { }
9365 = note: tuples have unspecified layout
9466
9567error: `extern` fn uses type `(i32, i32)`, which is not FFI-safe
96- --> $DIR/lint-ctypes-fn.rs:90 :34
68+ --> $DIR/lint-ctypes-fn.rs:88 :34
9769 |
9870LL | pub extern "C" fn tuple_type2(p: I32Pair) { }
9971 | ^^^^^^^ not FFI-safe
@@ -102,7 +74,7 @@ LL | pub extern "C" fn tuple_type2(p: I32Pair) { }
10274 = note: tuples have unspecified layout
10375
10476error: `extern` fn uses type `ZeroSize`, which is not FFI-safe
105- --> $DIR/lint-ctypes-fn.rs:93 :32
77+ --> $DIR/lint-ctypes-fn.rs:91 :32
10678 |
10779LL | pub extern "C" fn zero_size(p: ZeroSize) { }
10880 | ^^^^^^^^ not FFI-safe
@@ -116,7 +88,7 @@ LL | pub struct ZeroSize;
11688 | ^^^^^^^^^^^^^^^^^^^^
11789
11890error: `extern` fn uses type `ZeroSizeWithPhantomData`, which is not FFI-safe
119- --> $DIR/lint-ctypes-fn.rs:96 :40
91+ --> $DIR/lint-ctypes-fn.rs:94 :40
12092 |
12193LL | pub extern "C" fn zero_size_phantom(p: ZeroSizeWithPhantomData) { }
12294 | ^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -129,15 +101,15 @@ LL | pub struct ZeroSizeWithPhantomData(PhantomData<i32>);
129101 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130102
131103error: `extern` fn uses type `std::marker::PhantomData<bool>`, which is not FFI-safe
132- --> $DIR/lint-ctypes-fn.rs:99 :51
104+ --> $DIR/lint-ctypes-fn.rs:97 :51
133105 |
134106LL | pub extern "C" fn zero_size_phantom_toplevel() -> PhantomData<bool> {
135107 | ^^^^^^^^^^^^^^^^^ not FFI-safe
136108 |
137109 = note: composed only of `PhantomData`
138110
139111error: `extern` fn uses type `fn()`, which is not FFI-safe
140- --> $DIR/lint-ctypes-fn.rs:104 :30
112+ --> $DIR/lint-ctypes-fn.rs:102 :30
141113 |
142114LL | pub extern "C" fn fn_type(p: RustFn) { }
143115 | ^^^^^^ not FFI-safe
@@ -146,7 +118,7 @@ LL | pub extern "C" fn fn_type(p: RustFn) { }
146118 = note: this function pointer has Rust-specific calling convention
147119
148120error: `extern` fn uses type `fn()`, which is not FFI-safe
149- --> $DIR/lint-ctypes-fn.rs:107 :31
121+ --> $DIR/lint-ctypes-fn.rs:105 :31
150122 |
151123LL | pub extern "C" fn fn_type2(p: fn()) { }
152124 | ^^^^ not FFI-safe
@@ -155,7 +127,7 @@ LL | pub extern "C" fn fn_type2(p: fn()) { }
155127 = note: this function pointer has Rust-specific calling convention
156128
157129error: `extern` fn uses type `std::boxed::Box<u32>`, which is not FFI-safe
158- --> $DIR/lint-ctypes-fn.rs:110 :35
130+ --> $DIR/lint-ctypes-fn.rs:108 :35
159131 |
160132LL | pub extern "C" fn fn_contained(p: RustBadRet) { }
161133 | ^^^^^^^^^^ not FFI-safe
@@ -164,15 +136,15 @@ LL | pub extern "C" fn fn_contained(p: RustBadRet) { }
164136 = note: this struct has unspecified layout
165137
166138error: `extern` fn uses type `i128`, which is not FFI-safe
167- --> $DIR/lint-ctypes-fn.rs:113 :39
139+ --> $DIR/lint-ctypes-fn.rs:111 :39
168140 |
169141LL | pub extern "C" fn transparent_i128(p: TransparentI128) { }
170142 | ^^^^^^^^^^^^^^^ not FFI-safe
171143 |
172144 = note: 128-bit integers don't currently have a known stable ABI
173145
174146error: `extern` fn uses type `str`, which is not FFI-safe
175- --> $DIR/lint-ctypes-fn.rs:116 :38
147+ --> $DIR/lint-ctypes-fn.rs:114 :38
176148 |
177149LL | pub extern "C" fn transparent_str(p: TransparentStr) { }
178150 | ^^^^^^^^^^^^^^ not FFI-safe
@@ -181,52 +153,24 @@ LL | pub extern "C" fn transparent_str(p: TransparentStr) { }
181153 = note: string slices have no C equivalent
182154
183155error: `extern` fn uses type `std::boxed::Box<u32>`, which is not FFI-safe
184- --> $DIR/lint-ctypes-fn.rs:119 :37
156+ --> $DIR/lint-ctypes-fn.rs:117 :37
185157 |
186158LL | pub extern "C" fn transparent_fn(p: TransparentBadFn) { }
187159 | ^^^^^^^^^^^^^^^^ not FFI-safe
188160 |
189161 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
190162 = note: this struct has unspecified layout
191163
192- error: `extern` fn uses type `Foo`, which is not FFI-safe
193- --> $DIR/lint-ctypes-fn.rs:161:44
194- |
195- LL | pub extern "C" fn unused_generic1<T>(size: *const Foo) { }
196- | ^^^^^^^^^^ not FFI-safe
197- |
198- = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
199- = note: this struct has unspecified layout
200- note: the type is defined here
201- --> $DIR/lint-ctypes-fn.rs:34:1
202- |
203- LL | pub struct Foo;
204- | ^^^^^^^^^^^^^^^
205-
206164error: `extern` fn uses type `std::marker::PhantomData<bool>`, which is not FFI-safe
207- --> $DIR/lint-ctypes-fn.rs:164 :43
165+ --> $DIR/lint-ctypes-fn.rs:161 :43
208166 |
209167LL | pub extern "C" fn unused_generic2<T>() -> PhantomData<bool> {
210168 | ^^^^^^^^^^^^^^^^^ not FFI-safe
211169 |
212170 = note: composed only of `PhantomData`
213171
214- error: `extern` fn uses type `Foo`, which is not FFI-safe
215- --> $DIR/lint-ctypes-fn.rs:171:48
216- |
217- LL | pub extern "C" fn used_generic2<T>(x: T, size: *const Foo) { }
218- | ^^^^^^^^^^ not FFI-safe
219- |
220- = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
221- = note: this struct has unspecified layout
222- note: the type is defined here
223- --> $DIR/lint-ctypes-fn.rs:34:1
224- |
225- LL | pub struct Foo;
226- | ^^^^^^^^^^^^^^^
227-
228172error: `extern` fn uses type `std::vec::Vec<T>`, which is not FFI-safe
229- --> $DIR/lint-ctypes-fn.rs:178 :39
173+ --> $DIR/lint-ctypes-fn.rs:174 :39
230174 |
231175LL | pub extern "C" fn used_generic4<T>(x: Vec<T>) { }
232176 | ^^^^^^ not FFI-safe
@@ -235,13 +179,13 @@ LL | pub extern "C" fn used_generic4<T>(x: Vec<T>) { }
235179 = note: this struct has unspecified layout
236180
237181error: `extern` fn uses type `std::vec::Vec<T>`, which is not FFI-safe
238- --> $DIR/lint-ctypes-fn.rs:181 :41
182+ --> $DIR/lint-ctypes-fn.rs:177 :41
239183 |
240184LL | pub extern "C" fn used_generic5<T>() -> Vec<T> {
241185 | ^^^^^^ not FFI-safe
242186 |
243187 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
244188 = note: this struct has unspecified layout
245189
246- error: aborting due to 24 previous errors
190+ error: aborting due to 20 previous errors
247191
0 commit comments