1
1
error: `extern` fn uses type `[u32]`, which is not FFI-safe
2
- --> $DIR/lint-ctypes-fn.rs:67 :33
2
+ --> $DIR/lint-ctypes-fn.rs:69 :33
3
3
|
4
4
LL | pub extern "C" fn slice_type(p: &[u32]) { }
5
5
| ^^^^^^ not FFI-safe
@@ -13,16 +13,40 @@ LL | #![deny(improper_ctypes_definitions)]
13
13
= note: slices have no C equivalent
14
14
15
15
error: `extern` fn uses type `str`, which is not FFI-safe
16
- --> $DIR/lint-ctypes-fn.rs:70 :31
16
+ --> $DIR/lint-ctypes-fn.rs:72 :31
17
17
|
18
18
LL | pub extern "C" fn str_type(p: &str) { }
19
19
| ^^^^ not FFI-safe
20
20
|
21
21
= help: consider using `*const u8` and a length instead
22
22
= note: string slices have no C equivalent
23
23
24
+ error: `extern` fn uses type `Box<[u8]>`, which is not FFI-safe
25
+ --> $DIR/lint-ctypes-fn.rs:79:34
26
+ |
27
+ LL | pub extern "C" fn boxed_slice(p: Box<[u8]>) { }
28
+ | ^^^^^^^^^ not FFI-safe
29
+ |
30
+ = note: box cannot be represented as a single pointer
31
+
32
+ error: `extern` fn uses type `Box<str>`, which is not FFI-safe
33
+ --> $DIR/lint-ctypes-fn.rs:82:35
34
+ |
35
+ LL | pub extern "C" fn boxed_string(p: Box<str>) { }
36
+ | ^^^^^^^^ not FFI-safe
37
+ |
38
+ = note: box cannot be represented as a single pointer
39
+
40
+ error: `extern` fn uses type `Box<dyn Trait>`, which is not FFI-safe
41
+ --> $DIR/lint-ctypes-fn.rs:85:34
42
+ |
43
+ LL | pub extern "C" fn boxed_trait(p: Box<dyn Trait>) { }
44
+ | ^^^^^^^^^^^^^^ not FFI-safe
45
+ |
46
+ = note: box cannot be represented as a single pointer
47
+
24
48
error: `extern` fn uses type `char`, which is not FFI-safe
25
- --> $DIR/lint-ctypes-fn.rs:77 :32
49
+ --> $DIR/lint-ctypes-fn.rs:88 :32
26
50
|
27
51
LL | pub extern "C" fn char_type(p: char) { }
28
52
| ^^^^ not FFI-safe
@@ -31,23 +55,23 @@ LL | pub extern "C" fn char_type(p: char) { }
31
55
= note: the `char` type has no C equivalent
32
56
33
57
error: `extern` fn uses type `i128`, which is not FFI-safe
34
- --> $DIR/lint-ctypes-fn.rs:80 :32
58
+ --> $DIR/lint-ctypes-fn.rs:91 :32
35
59
|
36
60
LL | pub extern "C" fn i128_type(p: i128) { }
37
61
| ^^^^ not FFI-safe
38
62
|
39
63
= note: 128-bit integers don't currently have a known stable ABI
40
64
41
65
error: `extern` fn uses type `u128`, which is not FFI-safe
42
- --> $DIR/lint-ctypes-fn.rs:83 :32
66
+ --> $DIR/lint-ctypes-fn.rs:94 :32
43
67
|
44
68
LL | pub extern "C" fn u128_type(p: u128) { }
45
69
| ^^^^ not FFI-safe
46
70
|
47
71
= note: 128-bit integers don't currently have a known stable ABI
48
72
49
73
error: `extern` fn uses type `(i32, i32)`, which is not FFI-safe
50
- --> $DIR/lint-ctypes-fn.rs:86 :33
74
+ --> $DIR/lint-ctypes-fn.rs:97 :33
51
75
|
52
76
LL | pub extern "C" fn tuple_type(p: (i32, i32)) { }
53
77
| ^^^^^^^^^^ not FFI-safe
@@ -56,7 +80,7 @@ LL | pub extern "C" fn tuple_type(p: (i32, i32)) { }
56
80
= note: tuples have unspecified layout
57
81
58
82
error: `extern` fn uses type `(i32, i32)`, which is not FFI-safe
59
- --> $DIR/lint-ctypes-fn.rs:89 :34
83
+ --> $DIR/lint-ctypes-fn.rs:100 :34
60
84
|
61
85
LL | pub extern "C" fn tuple_type2(p: I32Pair) { }
62
86
| ^^^^^^^ not FFI-safe
@@ -65,42 +89,42 @@ LL | pub extern "C" fn tuple_type2(p: I32Pair) { }
65
89
= note: tuples have unspecified layout
66
90
67
91
error: `extern` fn uses type `ZeroSize`, which is not FFI-safe
68
- --> $DIR/lint-ctypes-fn.rs:92 :32
92
+ --> $DIR/lint-ctypes-fn.rs:103 :32
69
93
|
70
94
LL | pub extern "C" fn zero_size(p: ZeroSize) { }
71
95
| ^^^^^^^^ not FFI-safe
72
96
|
73
97
= help: consider adding a member to this struct
74
98
= note: this struct has no fields
75
99
note: the type is defined here
76
- --> $DIR/lint-ctypes-fn.rs:26 :1
100
+ --> $DIR/lint-ctypes-fn.rs:28 :1
77
101
|
78
102
LL | pub struct ZeroSize;
79
103
| ^^^^^^^^^^^^^^^^^^^^
80
104
81
105
error: `extern` fn uses type `ZeroSizeWithPhantomData`, which is not FFI-safe
82
- --> $DIR/lint-ctypes-fn.rs:95 :40
106
+ --> $DIR/lint-ctypes-fn.rs:106 :40
83
107
|
84
108
LL | pub extern "C" fn zero_size_phantom(p: ZeroSizeWithPhantomData) { }
85
109
| ^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
86
110
|
87
111
= note: composed only of `PhantomData`
88
112
note: the type is defined here
89
- --> $DIR/lint-ctypes-fn.rs:61 :1
113
+ --> $DIR/lint-ctypes-fn.rs:63 :1
90
114
|
91
115
LL | pub struct ZeroSizeWithPhantomData(PhantomData<i32>);
92
116
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93
117
94
118
error: `extern` fn uses type `PhantomData<bool>`, which is not FFI-safe
95
- --> $DIR/lint-ctypes-fn.rs:98 :51
119
+ --> $DIR/lint-ctypes-fn.rs:109 :51
96
120
|
97
121
LL | pub extern "C" fn zero_size_phantom_toplevel() -> PhantomData<bool> {
98
122
| ^^^^^^^^^^^^^^^^^ not FFI-safe
99
123
|
100
124
= note: composed only of `PhantomData`
101
125
102
126
error: `extern` fn uses type `fn()`, which is not FFI-safe
103
- --> $DIR/lint-ctypes-fn.rs:103 :30
127
+ --> $DIR/lint-ctypes-fn.rs:114 :30
104
128
|
105
129
LL | pub extern "C" fn fn_type(p: RustFn) { }
106
130
| ^^^^^^ not FFI-safe
@@ -109,7 +133,7 @@ LL | pub extern "C" fn fn_type(p: RustFn) { }
109
133
= note: this function pointer has Rust-specific calling convention
110
134
111
135
error: `extern` fn uses type `fn()`, which is not FFI-safe
112
- --> $DIR/lint-ctypes-fn.rs:106 :31
136
+ --> $DIR/lint-ctypes-fn.rs:117 :31
113
137
|
114
138
LL | pub extern "C" fn fn_type2(p: fn()) { }
115
139
| ^^^^ not FFI-safe
@@ -118,15 +142,15 @@ LL | pub extern "C" fn fn_type2(p: fn()) { }
118
142
= note: this function pointer has Rust-specific calling convention
119
143
120
144
error: `extern` fn uses type `i128`, which is not FFI-safe
121
- --> $DIR/lint-ctypes-fn.rs:111 :39
145
+ --> $DIR/lint-ctypes-fn.rs:122 :39
122
146
|
123
147
LL | pub extern "C" fn transparent_i128(p: TransparentI128) { }
124
148
| ^^^^^^^^^^^^^^^ not FFI-safe
125
149
|
126
150
= note: 128-bit integers don't currently have a known stable ABI
127
151
128
152
error: `extern` fn uses type `str`, which is not FFI-safe
129
- --> $DIR/lint-ctypes-fn.rs:114 :38
153
+ --> $DIR/lint-ctypes-fn.rs:125 :38
130
154
|
131
155
LL | pub extern "C" fn transparent_str(p: TransparentStr) { }
132
156
| ^^^^^^^^^^^^^^ not FFI-safe
@@ -135,15 +159,15 @@ LL | pub extern "C" fn transparent_str(p: TransparentStr) { }
135
159
= note: string slices have no C equivalent
136
160
137
161
error: `extern` fn uses type `PhantomData<bool>`, which is not FFI-safe
138
- --> $DIR/lint-ctypes-fn.rs:160 :43
162
+ --> $DIR/lint-ctypes-fn.rs:171 :43
139
163
|
140
164
LL | pub extern "C" fn unused_generic2<T>() -> PhantomData<bool> {
141
165
| ^^^^^^^^^^^^^^^^^ not FFI-safe
142
166
|
143
167
= note: composed only of `PhantomData`
144
168
145
169
error: `extern` fn uses type `Vec<T>`, which is not FFI-safe
146
- --> $DIR/lint-ctypes-fn.rs:173 :39
170
+ --> $DIR/lint-ctypes-fn.rs:184 :39
147
171
|
148
172
LL | pub extern "C" fn used_generic4<T>(x: Vec<T>) { }
149
173
| ^^^^^^ not FFI-safe
@@ -152,13 +176,13 @@ LL | pub extern "C" fn used_generic4<T>(x: Vec<T>) { }
152
176
= note: this struct has unspecified layout
153
177
154
178
error: `extern` fn uses type `Vec<T>`, which is not FFI-safe
155
- --> $DIR/lint-ctypes-fn.rs:176 :41
179
+ --> $DIR/lint-ctypes-fn.rs:187 :41
156
180
|
157
181
LL | pub extern "C" fn used_generic5<T>() -> Vec<T> {
158
182
| ^^^^^^ not FFI-safe
159
183
|
160
184
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
161
185
= note: this struct has unspecified layout
162
186
163
- error: aborting due to 17 previous errors
187
+ error: aborting due to 20 previous errors
164
188
0 commit comments