@@ -61,26 +61,8 @@ LL | pub fn str_type(p: &str);
61
61
= help: consider using `*const u8` and a length instead
62
62
= note: this reference to an unsized rust type contains metadata, which makes it incompatible with a C pointer
63
63
64
- error: `extern` block uses type `Box<u32>`, which is not FFI-safe
65
- --> $DIR/lint-ctypes.rs:53:24
66
- |
67
- LL | pub fn box_type(p: Box<u32>);
68
- | ^^^^^^^^ not FFI-safe
69
- |
70
- = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
71
- = note: this struct has unspecified layout
72
-
73
- error: `extern` block uses type `Option<Box<u32>>`, which is not FFI-safe
74
- --> $DIR/lint-ctypes.rs:67:28
75
- |
76
- LL | pub fn opt_box_type(p: Option<Box<u32>>);
77
- | ^^^^^^^^^^^^^^^^ not FFI-safe
78
- |
79
- = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
80
- = note: enum has no representation hint
81
-
82
64
error: `extern` block uses type `char`, which is not FFI-safe
83
- --> $DIR/lint-ctypes.rs:69 :25
65
+ --> $DIR/lint-ctypes.rs:68 :25
84
66
|
85
67
LL | pub fn char_type(p: char);
86
68
| ^^^^ not FFI-safe
@@ -89,31 +71,31 @@ LL | pub fn char_type(p: char);
89
71
= note: the `char` type has no C equivalent
90
72
91
73
error: `extern` block uses type `i128`, which is not FFI-safe
92
- --> $DIR/lint-ctypes.rs:70 :25
74
+ --> $DIR/lint-ctypes.rs:69 :25
93
75
|
94
76
LL | pub fn i128_type(p: i128);
95
77
| ^^^^ not FFI-safe
96
78
|
97
79
= note: 128-bit integers don't currently have a known stable ABI
98
80
99
81
error: `extern` block uses type `u128`, which is not FFI-safe
100
- --> $DIR/lint-ctypes.rs:71 :25
82
+ --> $DIR/lint-ctypes.rs:70 :25
101
83
|
102
84
LL | pub fn u128_type(p: u128);
103
85
| ^^^^ not FFI-safe
104
86
|
105
87
= note: 128-bit integers don't currently have a known stable ABI
106
88
107
89
error: `extern` block uses type `&dyn Bar`, which is not FFI-safe
108
- --> $DIR/lint-ctypes.rs:72 :26
90
+ --> $DIR/lint-ctypes.rs:71 :26
109
91
|
110
92
LL | pub fn trait_type(p: &dyn Bar);
111
93
| ^^^^^^^^ not FFI-safe
112
94
|
113
95
= note: this reference to an unsized rust type contains metadata, which makes it incompatible with a C pointer
114
96
115
97
error: `extern` block uses type `(i32, i32)`, which is not FFI-safe
116
- --> $DIR/lint-ctypes.rs:73 :26
98
+ --> $DIR/lint-ctypes.rs:72 :26
117
99
|
118
100
LL | pub fn tuple_type(p: (i32, i32));
119
101
| ^^^^^^^^^^ not FFI-safe
@@ -122,7 +104,7 @@ LL | pub fn tuple_type(p: (i32, i32));
122
104
= note: tuples have unspecified layout
123
105
124
106
error: `extern` block uses type `(i32, i32)`, which is not FFI-safe
125
- --> $DIR/lint-ctypes.rs:74 :27
107
+ --> $DIR/lint-ctypes.rs:73 :27
126
108
|
127
109
LL | pub fn tuple_type2(p: I32Pair);
128
110
| ^^^^^^^ not FFI-safe
@@ -131,7 +113,7 @@ LL | pub fn tuple_type2(p: I32Pair);
131
113
= note: tuples have unspecified layout
132
114
133
115
error: `extern` block uses type `ZeroSize`, which is not FFI-safe
134
- --> $DIR/lint-ctypes.rs:75 :25
116
+ --> $DIR/lint-ctypes.rs:74 :25
135
117
|
136
118
LL | pub fn zero_size(p: ZeroSize);
137
119
| ^^^^^^^^ not FFI-safe
@@ -145,7 +127,7 @@ LL | pub struct ZeroSize;
145
127
| ^^^^^^^^^^^^^^^^^^^
146
128
147
129
error: `extern` block uses type `ZeroSizeWithPhantomData`, which is not FFI-safe
148
- --> $DIR/lint-ctypes.rs:76 :33
130
+ --> $DIR/lint-ctypes.rs:75 :33
149
131
|
150
132
LL | pub fn zero_size_phantom(p: ZeroSizeWithPhantomData);
151
133
| ^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -158,15 +140,15 @@ LL | pub struct ZeroSizeWithPhantomData(::std::marker::PhantomData<i32>);
158
140
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
159
141
160
142
error: `extern` block uses type `PhantomData<bool>`, which is not FFI-safe
161
- --> $DIR/lint-ctypes.rs:79 :12
143
+ --> $DIR/lint-ctypes.rs:78 :12
162
144
|
163
145
LL | -> ::std::marker::PhantomData<bool>;
164
146
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
165
147
|
166
148
= note: composed only of `PhantomData`
167
149
168
150
error: `extern` block uses type `fn()`, which is not FFI-safe
169
- --> $DIR/lint-ctypes.rs:80 :23
151
+ --> $DIR/lint-ctypes.rs:79 :23
170
152
|
171
153
LL | pub fn fn_type(p: RustFn);
172
154
| ^^^^^^ not FFI-safe
@@ -175,51 +157,33 @@ LL | pub fn fn_type(p: RustFn);
175
157
= note: this function pointer has Rust-specific calling convention
176
158
177
159
error: `extern` block uses type `fn()`, which is not FFI-safe
178
- --> $DIR/lint-ctypes.rs:81 :24
160
+ --> $DIR/lint-ctypes.rs:80 :24
179
161
|
180
162
LL | pub fn fn_type2(p: fn());
181
163
| ^^^^ not FFI-safe
182
164
|
183
165
= help: consider using an `extern fn(...) -> ...` function pointer instead
184
166
= note: this function pointer has Rust-specific calling convention
185
167
186
- error: `extern` block uses type `Box<u32>`, which is not FFI-safe
187
- --> $DIR/lint-ctypes.rs:69:28
188
- |
189
- LL | pub fn fn_contained(p: RustBadRet);
190
- | ^^^^^^^^^^ not FFI-safe
191
- |
192
- = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
193
- = note: this struct has unspecified layout
194
-
195
168
error: `extern` block uses type `i128`, which is not FFI-safe
196
- --> $DIR/lint-ctypes.rs:83 :32
169
+ --> $DIR/lint-ctypes.rs:82 :32
197
170
|
198
171
LL | pub fn transparent_i128(p: TransparentI128);
199
172
| ^^^^^^^^^^^^^^^ not FFI-safe
200
173
|
201
174
= note: 128-bit integers don't currently have a known stable ABI
202
175
203
176
error: `extern` block uses type `&str`, which is not FFI-safe
204
- --> $DIR/lint-ctypes.rs:84 :31
177
+ --> $DIR/lint-ctypes.rs:83 :31
205
178
|
206
179
LL | pub fn transparent_str(p: TransparentStr);
207
180
| ^^^^^^^^^^^^^^ not FFI-safe
208
181
|
209
182
= help: consider using `*const u8` and a length instead
210
183
= note: this reference to an unsized rust type contains metadata, which makes it incompatible with a C pointer
211
184
212
- error: `extern` block uses type `Box<u32>`, which is not FFI-safe
213
- --> $DIR/lint-ctypes.rs:72:30
214
- |
215
- LL | pub fn transparent_fn(p: TransparentBadFn);
216
- | ^^^^^^^^^^^^^^^^ not FFI-safe
217
- |
218
- = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
219
- = note: this struct has unspecified layout
220
-
221
185
error: `extern` block uses type `[u8; 8]`, which is not FFI-safe
222
- --> $DIR/lint-ctypes.rs:86 :27
186
+ --> $DIR/lint-ctypes.rs:85 :27
223
187
|
224
188
LL | pub fn raw_array(arr: [u8; 8]);
225
189
| ^^^^^^^ not FFI-safe
@@ -228,15 +192,15 @@ LL | pub fn raw_array(arr: [u8; 8]);
228
192
= note: passing raw arrays by value is not FFI-safe
229
193
230
194
error: `extern` block uses type `&UnsizedStructBecauseDyn`, which is not FFI-safe
231
- --> $DIR/lint-ctypes.rs:89 :47
195
+ --> $DIR/lint-ctypes.rs:88 :47
232
196
|
233
197
LL | pub fn struct_unsized_ptr_has_metadata(p: &UnsizedStructBecauseDyn);
234
198
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
235
199
|
236
200
= note: this reference to an unsized rust type contains metadata, which makes it incompatible with a C pointer
237
201
238
202
error: `extern` block uses type `Option<UnsafeCell<extern "C" fn()>>`, which is not FFI-safe
239
- --> $DIR/lint-ctypes.rs:91 :26
203
+ --> $DIR/lint-ctypes.rs:90 :26
240
204
|
241
205
LL | pub fn no_niche_a(a: Option<UnsafeCell<extern fn()>>);
242
206
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -245,7 +209,7 @@ LL | pub fn no_niche_a(a: Option<UnsafeCell<extern fn()>>);
245
209
= note: enum has no representation hint
246
210
247
211
error: `extern` block uses type `Option<UnsafeCell<&i32>>`, which is not FFI-safe
248
- --> $DIR/lint-ctypes.rs:93 :26
212
+ --> $DIR/lint-ctypes.rs:92 :26
249
213
|
250
214
LL | pub fn no_niche_b(b: Option<UnsafeCell<&i32>>);
251
215
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -254,19 +218,20 @@ LL | pub fn no_niche_b(b: Option<UnsafeCell<&i32>>);
254
218
= note: enum has no representation hint
255
219
256
220
error: `extern` block uses type `u128`, which is not FFI-safe
257
- --> $DIR/lint-ctypes.rs:96 :34
221
+ --> $DIR/lint-ctypes.rs:95 :34
258
222
|
259
223
LL | pub static static_u128_type: u128;
260
224
| ^^^^ not FFI-safe
261
225
|
262
226
= note: 128-bit integers don't currently have a known stable ABI
263
227
264
228
error: `extern` block uses type `u128`, which is not FFI-safe
265
- --> $DIR/lint-ctypes.rs:97 :40
229
+ --> $DIR/lint-ctypes.rs:96 :40
266
230
|
267
231
LL | pub static static_u128_array_type: [u128; 16];
268
232
| ^^^^^^^^^^ not FFI-safe
269
233
|
270
234
= note: 128-bit integers don't currently have a known stable ABI
271
235
272
- error: aborting due to 29 previous errors
236
+ error: aborting due to 24 previous errors
237
+
0 commit comments