@@ -201,29 +201,29 @@ LL | pub fn raw_array(arr: [u8; 8]);
201
201
= note: passing raw arrays by value is not FFI-safe
202
202
203
203
error: `extern` block uses type `char`, which is not FFI-safe
204
- --> $DIR/lint-ctypes.rs:97:36
204
+ --> $DIR/lint-ctypes.rs:98:12
205
205
|
206
- LL | pub fn multi_errors_per_arg( f: for<'a> extern "C" fn(a:char, b:&dyn Debug, c: Box<TwoBadTypes<'a>>));
207
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
206
+ LL | f: for<'a> extern "C" fn(a:char, b:&dyn Debug, c: Box<TwoBadTypes<'a>>)
207
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
208
208
|
209
209
= note: the function pointer to `for<'a, 'b> extern "C" fn(char, &'a (dyn Debug + 'a), Box<TwoBadTypes<'b>>)` is FFI-unsafe due to `char`
210
210
= help: consider using `u32` or `libc::wchar_t` instead
211
211
= note: the `char` type has no C equivalent
212
212
213
213
error: `extern` block uses type `&dyn Debug`, which is not FFI-safe
214
- --> $DIR/lint-ctypes.rs:97:36
214
+ --> $DIR/lint-ctypes.rs:98:12
215
215
|
216
- LL | pub fn multi_errors_per_arg( f: for<'a> extern "C" fn(a:char, b:&dyn Debug, c: Box<TwoBadTypes<'a>>));
217
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
216
+ LL | f: for<'a> extern "C" fn(a:char, b:&dyn Debug, c: Box<TwoBadTypes<'a>>)
217
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
218
218
|
219
219
= note: the function pointer to `for<'a, 'b> extern "C" fn(char, &'a (dyn Debug + 'a), Box<TwoBadTypes<'b>>)` is FFI-unsafe due to `&dyn Debug`
220
220
= note: this reference to an unsized type contains metadata, which makes it incompatible with a C pointer
221
221
222
222
error: `extern` block uses type `&[u8]`, which is not FFI-safe
223
- --> $DIR/lint-ctypes.rs:97:36
223
+ --> $DIR/lint-ctypes.rs:98:12
224
224
|
225
- LL | pub fn multi_errors_per_arg( f: for<'a> extern "C" fn(a:char, b:&dyn Debug, c: Box<TwoBadTypes<'a>>));
226
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
225
+ LL | f: for<'a> extern "C" fn(a:char, b:&dyn Debug, c: Box<TwoBadTypes<'a>>)
226
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
227
227
|
228
228
= note: the function pointer to `for<'a, 'b> extern "C" fn(char, &'a (dyn Debug + 'a), Box<TwoBadTypes<'b>>)` is FFI-unsafe due to `Box<TwoBadTypes<'_>>`
229
229
= note: this reference (`Box<TwoBadTypes<'_>>`) is ABI-compatible with a C pointer, but `TwoBadTypes<'_>` itself does not have a C layout
@@ -237,15 +237,15 @@ LL | pub struct TwoBadTypes<'a> {
237
237
= note: this reference to an unsized type contains metadata, which makes it incompatible with a C pointer
238
238
239
239
error: `extern` block uses type `&UnsizedStructBecauseDyn`, which is not FFI-safe
240
- --> $DIR/lint-ctypes.rs:104 :47
240
+ --> $DIR/lint-ctypes.rs:106 :47
241
241
|
242
242
LL | pub fn struct_unsized_ptr_has_metadata(p: &UnsizedStructBecauseDyn);
243
243
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
244
244
|
245
245
= note: this reference to an unsized type contains metadata, which makes it incompatible with a C pointer
246
246
247
247
error: `extern` block uses type `Option<UnsafeCell<extern "C" fn()>>`, which is not FFI-safe
248
- --> $DIR/lint-ctypes.rs:106 :26
248
+ --> $DIR/lint-ctypes.rs:108 :26
249
249
|
250
250
LL | pub fn no_niche_a(a: Option<UnsafeCell<extern "C" fn()>>);
251
251
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -254,7 +254,7 @@ LL | pub fn no_niche_a(a: Option<UnsafeCell<extern "C" fn()>>);
254
254
= note: enum has no representation hint
255
255
256
256
error: `extern` block uses type `Option<UnsafeCell<&i32>>`, which is not FFI-safe
257
- --> $DIR/lint-ctypes.rs:108 :26
257
+ --> $DIR/lint-ctypes.rs:110 :26
258
258
|
259
259
LL | pub fn no_niche_b(b: Option<UnsafeCell<&i32>>);
260
260
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -263,15 +263,15 @@ LL | pub fn no_niche_b(b: Option<UnsafeCell<&i32>>);
263
263
= note: enum has no representation hint
264
264
265
265
error: `extern` block uses type `u128`, which is not FFI-safe
266
- --> $DIR/lint-ctypes.rs:111 :34
266
+ --> $DIR/lint-ctypes.rs:113 :34
267
267
|
268
268
LL | pub static static_u128_type: u128;
269
269
| ^^^^ not FFI-safe
270
270
|
271
271
= note: 128-bit integers don't currently have a known stable ABI
272
272
273
273
error: `extern` block uses type `u128`, which is not FFI-safe
274
- --> $DIR/lint-ctypes.rs:112 :40
274
+ --> $DIR/lint-ctypes.rs:114 :40
275
275
|
276
276
LL | pub static static_u128_array_type: [u128; 16];
277
277
| ^^^^^^^^^^ not FFI-safe
0 commit comments