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