1
1
error: `extern` block uses type `Foo`, which is not FFI-safe
2
- --> $DIR/lint-ctypes.rs:47 :28
2
+ --> $DIR/lint-ctypes.rs:60 :28
3
3
|
4
4
LL | pub fn ptr_type1(size: *const Foo);
5
5
| ^^^^^^^^^^ not FFI-safe
@@ -8,18 +8,18 @@ LL | pub fn ptr_type1(size: *const Foo);
8
8
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
9
9
= note: this struct has unspecified layout
10
10
note: the type is defined here
11
- --> $DIR/lint-ctypes.rs:25 :1
11
+ --> $DIR/lint-ctypes.rs:28 :1
12
12
|
13
13
LL | pub struct Foo;
14
14
| ^^^^^^^^^^^^^^
15
15
note: the lint level is defined here
16
- --> $DIR/lint-ctypes.rs:4 :9
16
+ --> $DIR/lint-ctypes.rs:5 :9
17
17
|
18
18
LL | #![deny(improper_ctypes)]
19
19
| ^^^^^^^^^^^^^^^
20
20
21
21
error: `extern` block uses type `Foo`, which is not FFI-safe
22
- --> $DIR/lint-ctypes.rs:48 :28
22
+ --> $DIR/lint-ctypes.rs:61 :28
23
23
|
24
24
LL | pub fn ptr_type2(size: *const Foo);
25
25
| ^^^^^^^^^^ not FFI-safe
@@ -28,13 +28,13 @@ LL | pub fn ptr_type2(size: *const Foo);
28
28
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
29
29
= note: this struct has unspecified layout
30
30
note: the type is defined here
31
- --> $DIR/lint-ctypes.rs:25 :1
31
+ --> $DIR/lint-ctypes.rs:28 :1
32
32
|
33
33
LL | pub struct Foo;
34
34
| ^^^^^^^^^^^^^^
35
35
36
36
error: `extern` block uses type `((),)`, which is not FFI-safe
37
- --> $DIR/lint-ctypes.rs:50 :25
37
+ --> $DIR/lint-ctypes.rs:63 :25
38
38
|
39
39
LL | pub fn ptr_tuple(p: *const ((),));
40
40
| ^^^^^^^^^^^^ not FFI-safe
@@ -44,7 +44,7 @@ LL | pub fn ptr_tuple(p: *const ((),));
44
44
= note: tuples have unspecified layout
45
45
46
46
error: `extern` block uses type `&[u32]`, which is not FFI-safe
47
- --> $DIR/lint-ctypes.rs:51 :26
47
+ --> $DIR/lint-ctypes.rs:64 :26
48
48
|
49
49
LL | pub fn slice_type(p: &[u32]);
50
50
| ^^^^^^ not FFI-safe
@@ -53,7 +53,7 @@ LL | pub fn slice_type(p: &[u32]);
53
53
= note: this reference to an unsized rust type contains metadata, which makes it incompatible with a C pointer
54
54
55
55
error: `extern` block uses type `&str`, which is not FFI-safe
56
- --> $DIR/lint-ctypes.rs:52 :24
56
+ --> $DIR/lint-ctypes.rs:65 :24
57
57
|
58
58
LL | pub fn str_type(p: &str);
59
59
| ^^^^ not FFI-safe
@@ -71,7 +71,7 @@ LL | pub fn box_type(p: Box<u32>);
71
71
= note: this struct has unspecified layout
72
72
73
73
error: `extern` block uses type `Option<Box<u32>>`, which is not FFI-safe
74
- --> $DIR/lint-ctypes.rs:54 :28
74
+ --> $DIR/lint-ctypes.rs:67 :28
75
75
|
76
76
LL | pub fn opt_box_type(p: Option<Box<u32>>);
77
77
| ^^^^^^^^^^^^^^^^ not FFI-safe
@@ -80,7 +80,7 @@ LL | pub fn opt_box_type(p: Option<Box<u32>>);
80
80
= note: enum has no representation hint
81
81
82
82
error: `extern` block uses type `char`, which is not FFI-safe
83
- --> $DIR/lint-ctypes.rs:56 :25
83
+ --> $DIR/lint-ctypes.rs:69 :25
84
84
|
85
85
LL | pub fn char_type(p: char);
86
86
| ^^^^ not FFI-safe
@@ -89,31 +89,31 @@ LL | pub fn char_type(p: char);
89
89
= note: the `char` type has no C equivalent
90
90
91
91
error: `extern` block uses type `i128`, which is not FFI-safe
92
- --> $DIR/lint-ctypes.rs:57 :25
92
+ --> $DIR/lint-ctypes.rs:70 :25
93
93
|
94
94
LL | pub fn i128_type(p: i128);
95
95
| ^^^^ not FFI-safe
96
96
|
97
97
= note: 128-bit integers don't currently have a known stable ABI
98
98
99
99
error: `extern` block uses type `u128`, which is not FFI-safe
100
- --> $DIR/lint-ctypes.rs:58 :25
100
+ --> $DIR/lint-ctypes.rs:71 :25
101
101
|
102
102
LL | pub fn u128_type(p: u128);
103
103
| ^^^^ not FFI-safe
104
104
|
105
105
= note: 128-bit integers don't currently have a known stable ABI
106
106
107
107
error: `extern` block uses type `&dyn Bar`, which is not FFI-safe
108
- --> $DIR/lint-ctypes.rs:59 :26
108
+ --> $DIR/lint-ctypes.rs:72 :26
109
109
|
110
110
LL | pub fn trait_type(p: &dyn Bar);
111
111
| ^^^^^^^^ not FFI-safe
112
112
|
113
113
= note: this reference to an unsized rust type contains metadata, which makes it incompatible with a C pointer
114
114
115
115
error: `extern` block uses type `(i32, i32)`, which is not FFI-safe
116
- --> $DIR/lint-ctypes.rs:60 :26
116
+ --> $DIR/lint-ctypes.rs:73 :26
117
117
|
118
118
LL | pub fn tuple_type(p: (i32, i32));
119
119
| ^^^^^^^^^^ not FFI-safe
@@ -122,7 +122,7 @@ LL | pub fn tuple_type(p: (i32, i32));
122
122
= note: tuples have unspecified layout
123
123
124
124
error: `extern` block uses type `(i32, i32)`, which is not FFI-safe
125
- --> $DIR/lint-ctypes.rs:61 :27
125
+ --> $DIR/lint-ctypes.rs:74 :27
126
126
|
127
127
LL | pub fn tuple_type2(p: I32Pair);
128
128
| ^^^^^^^ not FFI-safe
@@ -131,42 +131,42 @@ LL | pub fn tuple_type2(p: I32Pair);
131
131
= note: tuples have unspecified layout
132
132
133
133
error: `extern` block uses type `ZeroSize`, which is not FFI-safe
134
- --> $DIR/lint-ctypes.rs:62 :25
134
+ --> $DIR/lint-ctypes.rs:75 :25
135
135
|
136
136
LL | pub fn zero_size(p: ZeroSize);
137
137
| ^^^^^^^^ not FFI-safe
138
138
|
139
139
= help: consider adding a member to this struct
140
140
= note: this struct has no fields
141
141
note: the type is defined here
142
- --> $DIR/lint-ctypes.rs:21 :1
142
+ --> $DIR/lint-ctypes.rs:24 :1
143
143
|
144
144
LL | pub struct ZeroSize;
145
145
| ^^^^^^^^^^^^^^^^^^^
146
146
147
147
error: `extern` block uses type `ZeroSizeWithPhantomData`, which is not FFI-safe
148
- --> $DIR/lint-ctypes.rs:63 :33
148
+ --> $DIR/lint-ctypes.rs:76 :33
149
149
|
150
150
LL | pub fn zero_size_phantom(p: ZeroSizeWithPhantomData);
151
151
| ^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
152
152
|
153
153
= note: composed only of `PhantomData`
154
154
note: the type is defined here
155
- --> $DIR/lint-ctypes.rs:44 :1
155
+ --> $DIR/lint-ctypes.rs:57 :1
156
156
|
157
157
LL | pub struct ZeroSizeWithPhantomData(::std::marker::PhantomData<i32>);
158
158
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
159
159
160
160
error: `extern` block uses type `PhantomData<bool>`, which is not FFI-safe
161
- --> $DIR/lint-ctypes.rs:66 :12
161
+ --> $DIR/lint-ctypes.rs:79 :12
162
162
|
163
163
LL | -> ::std::marker::PhantomData<bool>;
164
164
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
165
165
|
166
166
= note: composed only of `PhantomData`
167
167
168
168
error: `extern` block uses type `fn()`, which is not FFI-safe
169
- --> $DIR/lint-ctypes.rs:67 :23
169
+ --> $DIR/lint-ctypes.rs:80 :23
170
170
|
171
171
LL | pub fn fn_type(p: RustFn);
172
172
| ^^^^^^ not FFI-safe
@@ -175,7 +175,7 @@ LL | pub fn fn_type(p: RustFn);
175
175
= note: this function pointer has Rust-specific calling convention
176
176
177
177
error: `extern` block uses type `fn()`, which is not FFI-safe
178
- --> $DIR/lint-ctypes.rs:68 :24
178
+ --> $DIR/lint-ctypes.rs:81 :24
179
179
|
180
180
LL | pub fn fn_type2(p: fn());
181
181
| ^^^^ not FFI-safe
@@ -193,15 +193,15 @@ LL | pub fn fn_contained(p: RustBadRet);
193
193
= note: this struct has unspecified layout
194
194
195
195
error: `extern` block uses type `i128`, which is not FFI-safe
196
- --> $DIR/lint-ctypes.rs:70 :32
196
+ --> $DIR/lint-ctypes.rs:83 :32
197
197
|
198
198
LL | pub fn transparent_i128(p: TransparentI128);
199
199
| ^^^^^^^^^^^^^^^ not FFI-safe
200
200
|
201
201
= note: 128-bit integers don't currently have a known stable ABI
202
202
203
203
error: `extern` block uses type `&str`, which is not FFI-safe
204
- --> $DIR/lint-ctypes.rs:71 :31
204
+ --> $DIR/lint-ctypes.rs:84 :31
205
205
|
206
206
LL | pub fn transparent_str(p: TransparentStr);
207
207
| ^^^^^^^^^^^^^^ not FFI-safe
@@ -219,16 +219,24 @@ LL | pub fn transparent_fn(p: TransparentBadFn);
219
219
= note: this struct has unspecified layout
220
220
221
221
error: `extern` block uses type `[u8; 8]`, which is not FFI-safe
222
- --> $DIR/lint-ctypes.rs:73 :27
222
+ --> $DIR/lint-ctypes.rs:86 :27
223
223
|
224
224
LL | pub fn raw_array(arr: [u8; 8]);
225
225
| ^^^^^^^ not FFI-safe
226
226
|
227
227
= help: consider passing a pointer to the array
228
228
= note: passing raw arrays by value is not FFI-safe
229
229
230
+ error: `extern` block uses type `&UnsizedStructBecauseDyn`, which is not FFI-safe
231
+ --> $DIR/lint-ctypes.rs:89:47
232
+ |
233
+ LL | pub fn struct_unsized_ptr_has_metadata(p: &UnsizedStructBecauseDyn);
234
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
235
+ |
236
+ = note: this reference to an unsized rust type contains metadata, which makes it incompatible with a C pointer
237
+
230
238
error: `extern` block uses type `Option<UnsafeCell<extern "C" fn()>>`, which is not FFI-safe
231
- --> $DIR/lint-ctypes.rs:75 :26
239
+ --> $DIR/lint-ctypes.rs:91 :26
232
240
|
233
241
LL | pub fn no_niche_a(a: Option<UnsafeCell<extern fn()>>);
234
242
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -237,7 +245,7 @@ LL | pub fn no_niche_a(a: Option<UnsafeCell<extern fn()>>);
237
245
= note: enum has no representation hint
238
246
239
247
error: `extern` block uses type `Option<UnsafeCell<&i32>>`, which is not FFI-safe
240
- --> $DIR/lint-ctypes.rs:77 :26
248
+ --> $DIR/lint-ctypes.rs:93 :26
241
249
|
242
250
LL | pub fn no_niche_b(b: Option<UnsafeCell<&i32>>);
243
251
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -246,19 +254,19 @@ LL | pub fn no_niche_b(b: Option<UnsafeCell<&i32>>);
246
254
= note: enum has no representation hint
247
255
248
256
error: `extern` block uses type `u128`, which is not FFI-safe
249
- --> $DIR/lint-ctypes.rs:80 :34
257
+ --> $DIR/lint-ctypes.rs:96 :34
250
258
|
251
259
LL | pub static static_u128_type: u128;
252
260
| ^^^^ not FFI-safe
253
261
|
254
262
= note: 128-bit integers don't currently have a known stable ABI
255
263
256
264
error: `extern` block uses type `u128`, which is not FFI-safe
257
- --> $DIR/lint-ctypes.rs:81 :40
265
+ --> $DIR/lint-ctypes.rs:97 :40
258
266
|
259
267
LL | pub static static_u128_array_type: [u128; 16];
260
268
| ^^^^^^^^^^ not FFI-safe
261
269
|
262
270
= note: 128-bit integers don't currently have a known stable ABI
263
271
264
- error: aborting due to 27 previous errors
272
+ error: aborting due to 29 previous errors
0 commit comments