1
- error: `extern` block uses type `Foo`, which is not FFI-safe
1
+ error: `extern` fn uses type `Foo`, which is not FFI-safe
2
2
--> $DIR/lint-ctypes-fn.rs:63:35
3
3
|
4
4
LL | pub extern "C" fn ptr_type1(size: *const Foo) { }
@@ -17,7 +17,7 @@ note: type defined here
17
17
LL | pub struct Foo;
18
18
| ^^^^^^^^^^^^^^^
19
19
20
- error: `extern` block uses type `Foo`, which is not FFI-safe
20
+ error: `extern` fn uses type `Foo`, which is not FFI-safe
21
21
--> $DIR/lint-ctypes-fn.rs:66:35
22
22
|
23
23
LL | pub extern "C" fn ptr_type2(size: *const Foo) { }
@@ -31,7 +31,7 @@ note: type defined here
31
31
LL | pub struct Foo;
32
32
| ^^^^^^^^^^^^^^^
33
33
34
- error: `extern` block uses type `[u32]`, which is not FFI-safe
34
+ error: `extern` fn uses type `[u32]`, which is not FFI-safe
35
35
--> $DIR/lint-ctypes-fn.rs:69:33
36
36
|
37
37
LL | pub extern "C" fn slice_type(p: &[u32]) { }
@@ -40,7 +40,7 @@ LL | pub extern "C" fn slice_type(p: &[u32]) { }
40
40
= help: consider using a raw pointer instead
41
41
= note: slices have no C equivalent
42
42
43
- error: `extern` block uses type `str`, which is not FFI-safe
43
+ error: `extern` fn uses type `str`, which is not FFI-safe
44
44
--> $DIR/lint-ctypes-fn.rs:72:31
45
45
|
46
46
LL | pub extern "C" fn str_type(p: &str) { }
@@ -49,7 +49,7 @@ LL | pub extern "C" fn str_type(p: &str) { }
49
49
= help: consider using `*const u8` and a length instead
50
50
= note: string slices have no C equivalent
51
51
52
- error: `extern` block uses type `std::boxed::Box<u32>`, which is not FFI-safe
52
+ error: `extern` fn uses type `std::boxed::Box<u32>`, which is not FFI-safe
53
53
--> $DIR/lint-ctypes-fn.rs:75:31
54
54
|
55
55
LL | pub extern "C" fn box_type(p: Box<u32>) { }
@@ -58,7 +58,7 @@ LL | pub extern "C" fn box_type(p: Box<u32>) { }
58
58
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
59
59
= note: this struct has unspecified layout
60
60
61
- error: `extern` block uses type `char`, which is not FFI-safe
61
+ error: `extern` fn uses type `char`, which is not FFI-safe
62
62
--> $DIR/lint-ctypes-fn.rs:78:32
63
63
|
64
64
LL | pub extern "C" fn char_type(p: char) { }
@@ -67,23 +67,23 @@ LL | pub extern "C" fn char_type(p: char) { }
67
67
= help: consider using `u32` or `libc::wchar_t` instead
68
68
= note: the `char` type has no C equivalent
69
69
70
- error: `extern` block uses type `i128`, which is not FFI-safe
70
+ error: `extern` fn uses type `i128`, which is not FFI-safe
71
71
--> $DIR/lint-ctypes-fn.rs:81:32
72
72
|
73
73
LL | pub extern "C" fn i128_type(p: i128) { }
74
74
| ^^^^ not FFI-safe
75
75
|
76
76
= note: 128-bit integers don't currently have a known stable ABI
77
77
78
- error: `extern` block uses type `u128`, which is not FFI-safe
78
+ error: `extern` fn uses type `u128`, which is not FFI-safe
79
79
--> $DIR/lint-ctypes-fn.rs:84:32
80
80
|
81
81
LL | pub extern "C" fn u128_type(p: u128) { }
82
82
| ^^^^ not FFI-safe
83
83
|
84
84
= note: 128-bit integers don't currently have a known stable ABI
85
85
86
- error: `extern` block uses type `(i32, i32)`, which is not FFI-safe
86
+ error: `extern` fn uses type `(i32, i32)`, which is not FFI-safe
87
87
--> $DIR/lint-ctypes-fn.rs:87:33
88
88
|
89
89
LL | pub extern "C" fn tuple_type(p: (i32, i32)) { }
@@ -92,7 +92,7 @@ LL | pub extern "C" fn tuple_type(p: (i32, i32)) { }
92
92
= help: consider using a struct instead
93
93
= note: tuples have unspecified layout
94
94
95
- error: `extern` block uses type `(i32, i32)`, which is not FFI-safe
95
+ error: `extern` fn uses type `(i32, i32)`, which is not FFI-safe
96
96
--> $DIR/lint-ctypes-fn.rs:90:34
97
97
|
98
98
LL | pub extern "C" fn tuple_type2(p: I32Pair) { }
@@ -101,7 +101,7 @@ LL | pub extern "C" fn tuple_type2(p: I32Pair) { }
101
101
= help: consider using a struct instead
102
102
= note: tuples have unspecified layout
103
103
104
- error: `extern` block uses type `ZeroSize`, which is not FFI-safe
104
+ error: `extern` fn uses type `ZeroSize`, which is not FFI-safe
105
105
--> $DIR/lint-ctypes-fn.rs:93:32
106
106
|
107
107
LL | pub extern "C" fn zero_size(p: ZeroSize) { }
@@ -115,7 +115,7 @@ note: type defined here
115
115
LL | pub struct ZeroSize;
116
116
| ^^^^^^^^^^^^^^^^^^^^
117
117
118
- error: `extern` block uses type `ZeroSizeWithPhantomData`, which is not FFI-safe
118
+ error: `extern` fn uses type `ZeroSizeWithPhantomData`, which is not FFI-safe
119
119
--> $DIR/lint-ctypes-fn.rs:96:40
120
120
|
121
121
LL | pub extern "C" fn zero_size_phantom(p: ZeroSizeWithPhantomData) { }
@@ -128,15 +128,15 @@ note: type defined here
128
128
LL | pub struct ZeroSizeWithPhantomData(PhantomData<i32>);
129
129
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130
130
131
- error: `extern` block uses type `std::marker::PhantomData<bool>`, which is not FFI-safe
131
+ error: `extern` fn uses type `std::marker::PhantomData<bool>`, which is not FFI-safe
132
132
--> $DIR/lint-ctypes-fn.rs:99:51
133
133
|
134
134
LL | pub extern "C" fn zero_size_phantom_toplevel() -> PhantomData<bool> {
135
135
| ^^^^^^^^^^^^^^^^^ not FFI-safe
136
136
|
137
137
= note: composed only of `PhantomData`
138
138
139
- error: `extern` block uses type `fn()`, which is not FFI-safe
139
+ error: `extern` fn uses type `fn()`, which is not FFI-safe
140
140
--> $DIR/lint-ctypes-fn.rs:104:30
141
141
|
142
142
LL | pub extern "C" fn fn_type(p: RustFn) { }
@@ -145,7 +145,7 @@ LL | pub extern "C" fn fn_type(p: RustFn) { }
145
145
= help: consider using an `extern fn(...) -> ...` function pointer instead
146
146
= note: this function pointer has Rust-specific calling convention
147
147
148
- error: `extern` block uses type `fn()`, which is not FFI-safe
148
+ error: `extern` fn uses type `fn()`, which is not FFI-safe
149
149
--> $DIR/lint-ctypes-fn.rs:107:31
150
150
|
151
151
LL | pub extern "C" fn fn_type2(p: fn()) { }
@@ -154,7 +154,7 @@ LL | pub extern "C" fn fn_type2(p: fn()) { }
154
154
= help: consider using an `extern fn(...) -> ...` function pointer instead
155
155
= note: this function pointer has Rust-specific calling convention
156
156
157
- error: `extern` block uses type `std::boxed::Box<u32>`, which is not FFI-safe
157
+ error: `extern` fn uses type `std::boxed::Box<u32>`, which is not FFI-safe
158
158
--> $DIR/lint-ctypes-fn.rs:110:35
159
159
|
160
160
LL | pub extern "C" fn fn_contained(p: RustBadRet) { }
@@ -163,15 +163,15 @@ LL | pub extern "C" fn fn_contained(p: RustBadRet) { }
163
163
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
164
164
= note: this struct has unspecified layout
165
165
166
- error: `extern` block uses type `i128`, which is not FFI-safe
166
+ error: `extern` fn uses type `i128`, which is not FFI-safe
167
167
--> $DIR/lint-ctypes-fn.rs:113:39
168
168
|
169
169
LL | pub extern "C" fn transparent_i128(p: TransparentI128) { }
170
170
| ^^^^^^^^^^^^^^^ not FFI-safe
171
171
|
172
172
= note: 128-bit integers don't currently have a known stable ABI
173
173
174
- error: `extern` block uses type `str`, which is not FFI-safe
174
+ error: `extern` fn uses type `str`, which is not FFI-safe
175
175
--> $DIR/lint-ctypes-fn.rs:116:38
176
176
|
177
177
LL | pub extern "C" fn transparent_str(p: TransparentStr) { }
@@ -180,7 +180,7 @@ LL | pub extern "C" fn transparent_str(p: TransparentStr) { }
180
180
= help: consider using `*const u8` and a length instead
181
181
= note: string slices have no C equivalent
182
182
183
- error: `extern` block uses type `std::boxed::Box<u32>`, which is not FFI-safe
183
+ error: `extern` fn uses type `std::boxed::Box<u32>`, which is not FFI-safe
184
184
--> $DIR/lint-ctypes-fn.rs:119:37
185
185
|
186
186
LL | pub extern "C" fn transparent_fn(p: TransparentBadFn) { }
@@ -189,7 +189,7 @@ LL | pub extern "C" fn transparent_fn(p: TransparentBadFn) { }
189
189
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
190
190
= note: this struct has unspecified layout
191
191
192
- error: `extern` block uses type `Foo`, which is not FFI-safe
192
+ error: `extern` fn uses type `Foo`, which is not FFI-safe
193
193
--> $DIR/lint-ctypes-fn.rs:161:44
194
194
|
195
195
LL | pub extern "C" fn unused_generic1<T>(size: *const Foo) { }
@@ -203,15 +203,15 @@ note: type defined here
203
203
LL | pub struct Foo;
204
204
| ^^^^^^^^^^^^^^^
205
205
206
- error: `extern` block uses type `std::marker::PhantomData<bool>`, which is not FFI-safe
206
+ error: `extern` fn uses type `std::marker::PhantomData<bool>`, which is not FFI-safe
207
207
--> $DIR/lint-ctypes-fn.rs:164:43
208
208
|
209
209
LL | pub extern "C" fn unused_generic2<T>() -> PhantomData<bool> {
210
210
| ^^^^^^^^^^^^^^^^^ not FFI-safe
211
211
|
212
212
= note: composed only of `PhantomData`
213
213
214
- error: `extern` block uses type `Foo`, which is not FFI-safe
214
+ error: `extern` fn uses type `Foo`, which is not FFI-safe
215
215
--> $DIR/lint-ctypes-fn.rs:171:48
216
216
|
217
217
LL | pub extern "C" fn used_generic2<T>(x: T, size: *const Foo) { }
@@ -225,7 +225,7 @@ note: type defined here
225
225
LL | pub struct Foo;
226
226
| ^^^^^^^^^^^^^^^
227
227
228
- error: `extern` block uses type `std::vec::Vec<T>`, which is not FFI-safe
228
+ error: `extern` fn uses type `std::vec::Vec<T>`, which is not FFI-safe
229
229
--> $DIR/lint-ctypes-fn.rs:178:39
230
230
|
231
231
LL | pub extern "C" fn used_generic4<T>(x: Vec<T>) { }
@@ -234,7 +234,7 @@ LL | pub extern "C" fn used_generic4<T>(x: Vec<T>) { }
234
234
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
235
235
= note: this struct has unspecified layout
236
236
237
- error: `extern` block uses type `std::vec::Vec<T>`, which is not FFI-safe
237
+ error: `extern` fn uses type `std::vec::Vec<T>`, which is not FFI-safe
238
238
--> $DIR/lint-ctypes-fn.rs:181:41
239
239
|
240
240
LL | pub extern "C" fn used_generic5<T>() -> Vec<T> {
0 commit comments