@@ -21,17 +21,8 @@ LL | pub extern "C" fn str_type(p: &str) { }
2121   = help: consider using `*const u8` and a length instead
2222   = note: string slices have no C equivalent
2323
24- error: `extern` fn uses type `std::boxed::Box<u32>`, which is not FFI-safe
25-   --> $DIR/lint-ctypes-fn.rs:73:31
26-    |
27- LL | pub extern "C" fn box_type(p: Box<u32>) { }
28-    |                               ^^^^^^^^ not FFI-safe
29-    |
30-    = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
31-    = note: this struct has unspecified layout
32- 
3324error: `extern` fn uses type `char`, which is not FFI-safe
34-   --> $DIR/lint-ctypes-fn.rs:76 :32
25+   --> $DIR/lint-ctypes-fn.rs:77 :32
3526   |
3627LL | pub extern "C" fn char_type(p: char) { }
3728   |                                ^^^^ not FFI-safe
@@ -40,23 +31,23 @@ LL | pub extern "C" fn char_type(p: char) { }
4031   = note: the `char` type has no C equivalent
4132
4233error: `extern` fn uses type `i128`, which is not FFI-safe
43-   --> $DIR/lint-ctypes-fn.rs:79 :32
34+   --> $DIR/lint-ctypes-fn.rs:80 :32
4435   |
4536LL | pub extern "C" fn i128_type(p: i128) { }
4637   |                                ^^^^ not FFI-safe
4738   |
4839   = note: 128-bit integers don't currently have a known stable ABI
4940
5041error: `extern` fn uses type `u128`, which is not FFI-safe
51-   --> $DIR/lint-ctypes-fn.rs:82 :32
42+   --> $DIR/lint-ctypes-fn.rs:83 :32
5243   |
5344LL | pub extern "C" fn u128_type(p: u128) { }
5445   |                                ^^^^ not FFI-safe
5546   |
5647   = note: 128-bit integers don't currently have a known stable ABI
5748
5849error: `extern` fn uses type `(i32, i32)`, which is not FFI-safe
59-   --> $DIR/lint-ctypes-fn.rs:85 :33
50+   --> $DIR/lint-ctypes-fn.rs:86 :33
6051   |
6152LL | pub extern "C" fn tuple_type(p: (i32, i32)) { }
6253   |                                 ^^^^^^^^^^ not FFI-safe
@@ -65,7 +56,7 @@ LL | pub extern "C" fn tuple_type(p: (i32, i32)) { }
6556   = note: tuples have unspecified layout
6657
6758error: `extern` fn uses type `(i32, i32)`, which is not FFI-safe
68-   --> $DIR/lint-ctypes-fn.rs:88 :34
59+   --> $DIR/lint-ctypes-fn.rs:89 :34
6960   |
7061LL | pub extern "C" fn tuple_type2(p: I32Pair) { }
7162   |                                  ^^^^^^^ not FFI-safe
@@ -74,7 +65,7 @@ LL | pub extern "C" fn tuple_type2(p: I32Pair) { }
7465   = note: tuples have unspecified layout
7566
7667error: `extern` fn uses type `ZeroSize`, which is not FFI-safe
77-   --> $DIR/lint-ctypes-fn.rs:91 :32
68+   --> $DIR/lint-ctypes-fn.rs:92 :32
7869   |
7970LL | pub extern "C" fn zero_size(p: ZeroSize) { }
8071   |                                ^^^^^^^^ not FFI-safe
@@ -88,7 +79,7 @@ LL | pub struct ZeroSize;
8879   | ^^^^^^^^^^^^^^^^^^^^
8980
9081error: `extern` fn uses type `ZeroSizeWithPhantomData`, which is not FFI-safe
91-   --> $DIR/lint-ctypes-fn.rs:94 :40
82+   --> $DIR/lint-ctypes-fn.rs:95 :40
9283   |
9384LL | pub extern "C" fn zero_size_phantom(p: ZeroSizeWithPhantomData) { }
9485   |                                        ^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -101,15 +92,15 @@ LL | pub struct ZeroSizeWithPhantomData(PhantomData<i32>);
10192   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10293
10394error: `extern` fn uses type `std::marker::PhantomData<bool>`, which is not FFI-safe
104-   --> $DIR/lint-ctypes-fn.rs:97 :51
95+   --> $DIR/lint-ctypes-fn.rs:98 :51
10596   |
10697LL | pub extern "C" fn zero_size_phantom_toplevel() -> PhantomData<bool> {
10798   |                                                   ^^^^^^^^^^^^^^^^^ not FFI-safe
10899   |
109100   = note: composed only of `PhantomData`
110101
111102error: `extern` fn uses type `fn()`, which is not FFI-safe
112-   --> $DIR/lint-ctypes-fn.rs:102 :30
103+   --> $DIR/lint-ctypes-fn.rs:103 :30
113104   |
114105LL | pub extern "C" fn fn_type(p: RustFn) { }
115106   |                              ^^^^^^ not FFI-safe
@@ -118,23 +109,14 @@ LL | pub extern "C" fn fn_type(p: RustFn) { }
118109   = note: this function pointer has Rust-specific calling convention
119110
120111error: `extern` fn uses type `fn()`, which is not FFI-safe
121-   --> $DIR/lint-ctypes-fn.rs:105 :31
112+   --> $DIR/lint-ctypes-fn.rs:106 :31
122113   |
123114LL | pub extern "C" fn fn_type2(p: fn()) { }
124115   |                               ^^^^ not FFI-safe
125116   |
126117   = help: consider using an `extern fn(...) -> ...` function pointer instead
127118   = note: this function pointer has Rust-specific calling convention
128119
129- error: `extern` fn uses type `std::boxed::Box<u32>`, which is not FFI-safe
130-   --> $DIR/lint-ctypes-fn.rs:108:35
131-    |
132- LL | pub extern "C" fn fn_contained(p: RustBadRet) { }
133-    |                                   ^^^^^^^^^^ not FFI-safe
134-    |
135-    = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
136-    = note: this struct has unspecified layout
137- 
138120error: `extern` fn uses type `i128`, which is not FFI-safe
139121  --> $DIR/lint-ctypes-fn.rs:111:39
140122   |
@@ -152,25 +134,16 @@ LL | pub extern "C" fn transparent_str(p: TransparentStr) { }
152134   = help: consider using `*const u8` and a length instead
153135   = note: string slices have no C equivalent
154136
155- error: `extern` fn uses type `std::boxed::Box<u32>`, which is not FFI-safe
156-   --> $DIR/lint-ctypes-fn.rs:117:37
157-    |
158- LL | pub extern "C" fn transparent_fn(p: TransparentBadFn) { }
159-    |                                     ^^^^^^^^^^^^^^^^ not FFI-safe
160-    |
161-    = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
162-    = note: this struct has unspecified layout
163- 
164137error: `extern` fn uses type `std::marker::PhantomData<bool>`, which is not FFI-safe
165-   --> $DIR/lint-ctypes-fn.rs:161 :43
138+   --> $DIR/lint-ctypes-fn.rs:160 :43
166139   |
167140LL | pub extern "C" fn unused_generic2<T>() -> PhantomData<bool> {
168141   |                                           ^^^^^^^^^^^^^^^^^ not FFI-safe
169142   |
170143   = note: composed only of `PhantomData`
171144
172145error: `extern` fn uses type `std::vec::Vec<T>`, which is not FFI-safe
173-   --> $DIR/lint-ctypes-fn.rs:174 :39
146+   --> $DIR/lint-ctypes-fn.rs:173 :39
174147   |
175148LL | pub extern "C" fn used_generic4<T>(x: Vec<T>) { }
176149   |                                       ^^^^^^ not FFI-safe
@@ -179,13 +152,13 @@ LL | pub extern "C" fn used_generic4<T>(x: Vec<T>) { }
179152   = note: this struct has unspecified layout
180153
181154error: `extern` fn uses type `std::vec::Vec<T>`, which is not FFI-safe
182-   --> $DIR/lint-ctypes-fn.rs:177 :41
155+   --> $DIR/lint-ctypes-fn.rs:176 :41
183156   |
184157LL | pub extern "C" fn used_generic5<T>() -> Vec<T> {
185158   |                                         ^^^^^^ not FFI-safe
186159   |
187160   = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
188161   = note: this struct has unspecified layout
189162
190- error: aborting due to 20  previous errors
163+ error: aborting due to 17  previous errors
191164
0 commit comments