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