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