@@ -30,5 +30,97 @@ LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
3030 = help: consider using a raw pointer instead
3131 = note: slices have no C equivalent
3232
33- error: aborting due to 3 previous errors
33+ error: `extern` fn uses type `[u8]`, which is not FFI-safe
34+ --> $DIR/lint-ctypes-94223.rs:11:18
35+ |
36+ LL | struct BadStruct(extern "C" fn([u8]));
37+ | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
38+ |
39+ = help: consider using a raw pointer instead
40+ = note: slices have no C equivalent
41+
42+ error: `extern` fn uses type `[u8]`, which is not FFI-safe
43+ --> $DIR/lint-ctypes-94223.rs:15:7
44+ |
45+ LL | A(extern "C" fn([u8])),
46+ | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
47+ |
48+ = help: consider using a raw pointer instead
49+ = note: slices have no C equivalent
50+
51+ error: `extern` fn uses type `[u8]`, which is not FFI-safe
52+ --> $DIR/lint-ctypes-94223.rs:20:7
53+ |
54+ LL | A(extern "C" fn([u8])),
55+ | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
56+ |
57+ = help: consider using a raw pointer instead
58+ = note: slices have no C equivalent
59+
60+ error: `extern` fn uses type `[u8]`, which is not FFI-safe
61+ --> $DIR/lint-ctypes-94223.rs:24:12
62+ |
63+ LL | type Foo = extern "C" fn([u8]);
64+ | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
65+ |
66+ = help: consider using a raw pointer instead
67+ = note: slices have no C equivalent
68+
69+ error: `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
70+ --> $DIR/lint-ctypes-94223.rs:34:17
71+ |
72+ LL | pub static BAD: extern "C" fn(FfiUnsafe) = f;
73+ | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
74+ |
75+ = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
76+ = note: this struct has unspecified layout
77+ note: the type is defined here
78+ --> $DIR/lint-ctypes-94223.rs:27:1
79+ |
80+ LL | pub struct FfiUnsafe;
81+ | ^^^^^^^^^^^^^^^^^^^^
82+
83+ error: `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
84+ --> $DIR/lint-ctypes-94223.rs:37:30
85+ |
86+ LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUnsafe)> = Ok(f);
87+ | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
88+ |
89+ = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
90+ = note: this struct has unspecified layout
91+ note: the type is defined here
92+ --> $DIR/lint-ctypes-94223.rs:27:1
93+ |
94+ LL | pub struct FfiUnsafe;
95+ | ^^^^^^^^^^^^^^^^^^^^
96+
97+ error: `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
98+ --> $DIR/lint-ctypes-94223.rs:37:56
99+ |
100+ LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUnsafe)> = Ok(f);
101+ | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
102+ |
103+ = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
104+ = note: this struct has unspecified layout
105+ note: the type is defined here
106+ --> $DIR/lint-ctypes-94223.rs:27:1
107+ |
108+ LL | pub struct FfiUnsafe;
109+ | ^^^^^^^^^^^^^^^^^^^^
110+
111+ error: `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
112+ --> $DIR/lint-ctypes-94223.rs:41:22
113+ |
114+ LL | pub const BAD_CONST: extern "C" fn(FfiUnsafe) = f;
115+ | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
116+ |
117+ = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
118+ = note: this struct has unspecified layout
119+ note: the type is defined here
120+ --> $DIR/lint-ctypes-94223.rs:27:1
121+ |
122+ LL | pub struct FfiUnsafe;
123+ | ^^^^^^^^^^^^^^^^^^^^
124+
125+ error: aborting due to 11 previous errors
34126
0 commit comments