1- error: `extern` block uses type `Foo`, which is not FFI-safe
1+ error: `extern` fn uses type `Foo`, which is not FFI-safe
22 --> $DIR/lint-ctypes-fn.rs:63:35
33 |
44LL | pub extern "C" fn ptr_type1(size: *const Foo) { }
@@ -17,7 +17,7 @@ note: type defined here
1717LL | pub struct Foo;
1818 | ^^^^^^^^^^^^^^^
1919
20- error: `extern` block uses type `Foo`, which is not FFI-safe
20+ error: `extern` fn uses type `Foo`, which is not FFI-safe
2121 --> $DIR/lint-ctypes-fn.rs:66:35
2222 |
2323LL | pub extern "C" fn ptr_type2(size: *const Foo) { }
@@ -31,7 +31,7 @@ note: type defined here
3131LL | pub struct Foo;
3232 | ^^^^^^^^^^^^^^^
3333
34- error: `extern` block uses type `[u32]`, which is not FFI-safe
34+ error: `extern` fn uses type `[u32]`, which is not FFI-safe
3535 --> $DIR/lint-ctypes-fn.rs:69:33
3636 |
3737LL | pub extern "C" fn slice_type(p: &[u32]) { }
@@ -40,7 +40,7 @@ LL | pub extern "C" fn slice_type(p: &[u32]) { }
4040 = help: consider using a raw pointer instead
4141 = note: slices have no C equivalent
4242
43- error: `extern` block uses type `str`, which is not FFI-safe
43+ error: `extern` fn uses type `str`, which is not FFI-safe
4444 --> $DIR/lint-ctypes-fn.rs:72:31
4545 |
4646LL | pub extern "C" fn str_type(p: &str) { }
@@ -49,7 +49,7 @@ LL | pub extern "C" fn str_type(p: &str) { }
4949 = help: consider using `*const u8` and a length instead
5050 = note: string slices have no C equivalent
5151
52- error: `extern` block uses type `std::boxed::Box<u32>`, which is not FFI-safe
52+ error: `extern` fn uses type `std::boxed::Box<u32>`, which is not FFI-safe
5353 --> $DIR/lint-ctypes-fn.rs:75:31
5454 |
5555LL | pub extern "C" fn box_type(p: Box<u32>) { }
@@ -58,7 +58,7 @@ LL | pub extern "C" fn box_type(p: Box<u32>) { }
5858 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
5959 = note: this struct has unspecified layout
6060
61- error: `extern` block uses type `char`, which is not FFI-safe
61+ error: `extern` fn uses type `char`, which is not FFI-safe
6262 --> $DIR/lint-ctypes-fn.rs:78:32
6363 |
6464LL | pub extern "C" fn char_type(p: char) { }
@@ -67,23 +67,23 @@ LL | pub extern "C" fn char_type(p: char) { }
6767 = help: consider using `u32` or `libc::wchar_t` instead
6868 = note: the `char` type has no C equivalent
6969
70- error: `extern` block uses type `i128`, which is not FFI-safe
70+ error: `extern` fn uses type `i128`, which is not FFI-safe
7171 --> $DIR/lint-ctypes-fn.rs:81:32
7272 |
7373LL | pub extern "C" fn i128_type(p: i128) { }
7474 | ^^^^ not FFI-safe
7575 |
7676 = note: 128-bit integers don't currently have a known stable ABI
7777
78- error: `extern` block uses type `u128`, which is not FFI-safe
78+ error: `extern` fn uses type `u128`, which is not FFI-safe
7979 --> $DIR/lint-ctypes-fn.rs:84:32
8080 |
8181LL | pub extern "C" fn u128_type(p: u128) { }
8282 | ^^^^ not FFI-safe
8383 |
8484 = note: 128-bit integers don't currently have a known stable ABI
8585
86- error: `extern` block uses type `(i32, i32)`, which is not FFI-safe
86+ error: `extern` fn uses type `(i32, i32)`, which is not FFI-safe
8787 --> $DIR/lint-ctypes-fn.rs:87:33
8888 |
8989LL | pub extern "C" fn tuple_type(p: (i32, i32)) { }
@@ -92,7 +92,7 @@ LL | pub extern "C" fn tuple_type(p: (i32, i32)) { }
9292 = help: consider using a struct instead
9393 = note: tuples have unspecified layout
9494
95- error: `extern` block uses type `(i32, i32)`, which is not FFI-safe
95+ error: `extern` fn uses type `(i32, i32)`, which is not FFI-safe
9696 --> $DIR/lint-ctypes-fn.rs:90:34
9797 |
9898LL | pub extern "C" fn tuple_type2(p: I32Pair) { }
@@ -101,7 +101,7 @@ LL | pub extern "C" fn tuple_type2(p: I32Pair) { }
101101 = help: consider using a struct instead
102102 = note: tuples have unspecified layout
103103
104- error: `extern` block uses type `ZeroSize`, which is not FFI-safe
104+ error: `extern` fn uses type `ZeroSize`, which is not FFI-safe
105105 --> $DIR/lint-ctypes-fn.rs:93:32
106106 |
107107LL | pub extern "C" fn zero_size(p: ZeroSize) { }
@@ -115,7 +115,7 @@ note: type defined here
115115LL | pub struct ZeroSize;
116116 | ^^^^^^^^^^^^^^^^^^^^
117117
118- error: `extern` block uses type `ZeroSizeWithPhantomData`, which is not FFI-safe
118+ error: `extern` fn uses type `ZeroSizeWithPhantomData`, which is not FFI-safe
119119 --> $DIR/lint-ctypes-fn.rs:96:40
120120 |
121121LL | pub extern "C" fn zero_size_phantom(p: ZeroSizeWithPhantomData) { }
@@ -128,15 +128,15 @@ note: type defined here
128128LL | pub struct ZeroSizeWithPhantomData(PhantomData<i32>);
129129 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130130
131- error: `extern` block uses type `std::marker::PhantomData<bool>`, which is not FFI-safe
131+ error: `extern` fn uses type `std::marker::PhantomData<bool>`, which is not FFI-safe
132132 --> $DIR/lint-ctypes-fn.rs:99:51
133133 |
134134LL | pub extern "C" fn zero_size_phantom_toplevel() -> PhantomData<bool> {
135135 | ^^^^^^^^^^^^^^^^^ not FFI-safe
136136 |
137137 = note: composed only of `PhantomData`
138138
139- error: `extern` block uses type `fn()`, which is not FFI-safe
139+ error: `extern` fn uses type `fn()`, which is not FFI-safe
140140 --> $DIR/lint-ctypes-fn.rs:104:30
141141 |
142142LL | pub extern "C" fn fn_type(p: RustFn) { }
@@ -145,7 +145,7 @@ LL | pub extern "C" fn fn_type(p: RustFn) { }
145145 = help: consider using an `extern fn(...) -> ...` function pointer instead
146146 = note: this function pointer has Rust-specific calling convention
147147
148- error: `extern` block uses type `fn()`, which is not FFI-safe
148+ error: `extern` fn uses type `fn()`, which is not FFI-safe
149149 --> $DIR/lint-ctypes-fn.rs:107:31
150150 |
151151LL | pub extern "C" fn fn_type2(p: fn()) { }
@@ -154,7 +154,7 @@ LL | pub extern "C" fn fn_type2(p: fn()) { }
154154 = help: consider using an `extern fn(...) -> ...` function pointer instead
155155 = note: this function pointer has Rust-specific calling convention
156156
157- error: `extern` block uses type `std::boxed::Box<u32>`, which is not FFI-safe
157+ error: `extern` fn uses type `std::boxed::Box<u32>`, which is not FFI-safe
158158 --> $DIR/lint-ctypes-fn.rs:110:35
159159 |
160160LL | pub extern "C" fn fn_contained(p: RustBadRet) { }
@@ -163,15 +163,15 @@ LL | pub extern "C" fn fn_contained(p: RustBadRet) { }
163163 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
164164 = note: this struct has unspecified layout
165165
166- error: `extern` block uses type `i128`, which is not FFI-safe
166+ error: `extern` fn uses type `i128`, which is not FFI-safe
167167 --> $DIR/lint-ctypes-fn.rs:113:39
168168 |
169169LL | pub extern "C" fn transparent_i128(p: TransparentI128) { }
170170 | ^^^^^^^^^^^^^^^ not FFI-safe
171171 |
172172 = note: 128-bit integers don't currently have a known stable ABI
173173
174- error: `extern` block uses type `str`, which is not FFI-safe
174+ error: `extern` fn uses type `str`, which is not FFI-safe
175175 --> $DIR/lint-ctypes-fn.rs:116:38
176176 |
177177LL | pub extern "C" fn transparent_str(p: TransparentStr) { }
@@ -180,7 +180,7 @@ LL | pub extern "C" fn transparent_str(p: TransparentStr) { }
180180 = help: consider using `*const u8` and a length instead
181181 = note: string slices have no C equivalent
182182
183- error: `extern` block uses type `std::boxed::Box<u32>`, which is not FFI-safe
183+ error: `extern` fn uses type `std::boxed::Box<u32>`, which is not FFI-safe
184184 --> $DIR/lint-ctypes-fn.rs:119:37
185185 |
186186LL | pub extern "C" fn transparent_fn(p: TransparentBadFn) { }
@@ -189,7 +189,7 @@ LL | pub extern "C" fn transparent_fn(p: TransparentBadFn) { }
189189 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
190190 = note: this struct has unspecified layout
191191
192- error: `extern` block uses type `Foo`, which is not FFI-safe
192+ error: `extern` fn uses type `Foo`, which is not FFI-safe
193193 --> $DIR/lint-ctypes-fn.rs:161:44
194194 |
195195LL | pub extern "C" fn unused_generic1<T>(size: *const Foo) { }
@@ -203,15 +203,15 @@ note: type defined here
203203LL | pub struct Foo;
204204 | ^^^^^^^^^^^^^^^
205205
206- error: `extern` block uses type `std::marker::PhantomData<bool>`, which is not FFI-safe
206+ error: `extern` fn uses type `std::marker::PhantomData<bool>`, which is not FFI-safe
207207 --> $DIR/lint-ctypes-fn.rs:164:43
208208 |
209209LL | pub extern "C" fn unused_generic2<T>() -> PhantomData<bool> {
210210 | ^^^^^^^^^^^^^^^^^ not FFI-safe
211211 |
212212 = note: composed only of `PhantomData`
213213
214- error: `extern` block uses type `Foo`, which is not FFI-safe
214+ error: `extern` fn uses type `Foo`, which is not FFI-safe
215215 --> $DIR/lint-ctypes-fn.rs:171:48
216216 |
217217LL | pub extern "C" fn used_generic2<T>(x: T, size: *const Foo) { }
@@ -225,7 +225,7 @@ note: type defined here
225225LL | pub struct Foo;
226226 | ^^^^^^^^^^^^^^^
227227
228- error: `extern` block uses type `std::vec::Vec<T>`, which is not FFI-safe
228+ error: `extern` fn uses type `std::vec::Vec<T>`, which is not FFI-safe
229229 --> $DIR/lint-ctypes-fn.rs:178:39
230230 |
231231LL | pub extern "C" fn used_generic4<T>(x: Vec<T>) { }
@@ -234,7 +234,7 @@ LL | pub extern "C" fn used_generic4<T>(x: Vec<T>) { }
234234 = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
235235 = note: this struct has unspecified layout
236236
237- error: `extern` block uses type `std::vec::Vec<T>`, which is not FFI-safe
237+ error: `extern` fn uses type `std::vec::Vec<T>`, which is not FFI-safe
238238 --> $DIR/lint-ctypes-fn.rs:181:41
239239 |
240240LL | pub extern "C" fn used_generic5<T>() -> Vec<T> {
0 commit comments