]> git.lizzy.rs Git - rust.git/blob - tests/ui/lint/lint-ctypes.stderr
Auto merge of #106884 - clubby789:fieldless-enum-debug, r=michaelwoerister
[rust.git] / tests / ui / lint / lint-ctypes.stderr
1 error: `extern` block uses type `Foo`, which is not FFI-safe
2   --> $DIR/lint-ctypes.rs:48:28
3    |
4 LL |     pub fn ptr_type1(size: *const Foo);
5    |                            ^^^^^^^^^^ not FFI-safe
6    |
7    = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
8    = note: this struct has unspecified layout
9 note: the type is defined here
10   --> $DIR/lint-ctypes.rs:26:1
11    |
12 LL | pub struct Foo;
13    | ^^^^^^^^^^^^^^
14 note: the lint level is defined here
15   --> $DIR/lint-ctypes.rs:4:9
16    |
17 LL | #![deny(improper_ctypes)]
18    |         ^^^^^^^^^^^^^^^
19
20 error: `extern` block uses type `Foo`, which is not FFI-safe
21   --> $DIR/lint-ctypes.rs:49:28
22    |
23 LL |     pub 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.rs:26:1
30    |
31 LL | pub struct Foo;
32    | ^^^^^^^^^^^^^^
33
34 error: `extern` block uses type `((),)`, which is not FFI-safe
35   --> $DIR/lint-ctypes.rs:51:25
36    |
37 LL |     pub fn ptr_tuple(p: *const ((),));
38    |                         ^^^^^^^^^^^^ not FFI-safe
39    |
40    = help: consider using a struct instead
41    = note: tuples have unspecified layout
42
43 error: `extern` block uses type `[u32]`, which is not FFI-safe
44   --> $DIR/lint-ctypes.rs:52:26
45    |
46 LL |     pub fn slice_type(p: &[u32]);
47    |                          ^^^^^^ not FFI-safe
48    |
49    = help: consider using a raw pointer instead
50    = note: slices have no C equivalent
51
52 error: `extern` block uses type `str`, which is not FFI-safe
53   --> $DIR/lint-ctypes.rs:53:24
54    |
55 LL |     pub fn str_type(p: &str);
56    |                        ^^^^ not FFI-safe
57    |
58    = help: consider using `*const u8` and a length instead
59    = note: string slices have no C equivalent
60
61 error: `extern` block uses type `Box<u32>`, which is not FFI-safe
62   --> $DIR/lint-ctypes.rs:54:24
63    |
64 LL |     pub fn box_type(p: Box<u32>);
65    |                        ^^^^^^^^ not FFI-safe
66    |
67    = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
68    = note: this struct has unspecified layout
69
70 error: `extern` block uses type `Option<Box<u32>>`, which is not FFI-safe
71   --> $DIR/lint-ctypes.rs:55:28
72    |
73 LL |     pub fn opt_box_type(p: Option<Box<u32>>);
74    |                            ^^^^^^^^^^^^^^^^ not FFI-safe
75    |
76    = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
77    = note: enum has no representation hint
78
79 error: `extern` block uses type `char`, which is not FFI-safe
80   --> $DIR/lint-ctypes.rs:57:25
81    |
82 LL |     pub fn char_type(p: char);
83    |                         ^^^^ not FFI-safe
84    |
85    = help: consider using `u32` or `libc::wchar_t` instead
86    = note: the `char` type has no C equivalent
87
88 error: `extern` block uses type `i128`, which is not FFI-safe
89   --> $DIR/lint-ctypes.rs:58:25
90    |
91 LL |     pub fn i128_type(p: i128);
92    |                         ^^^^ not FFI-safe
93    |
94    = note: 128-bit integers don't currently have a known stable ABI
95
96 error: `extern` block uses type `u128`, which is not FFI-safe
97   --> $DIR/lint-ctypes.rs:59:25
98    |
99 LL |     pub fn u128_type(p: u128);
100    |                         ^^^^ not FFI-safe
101    |
102    = note: 128-bit integers don't currently have a known stable ABI
103
104 error: `extern` block uses type `dyn Bar`, which is not FFI-safe
105   --> $DIR/lint-ctypes.rs:60:26
106    |
107 LL |     pub fn trait_type(p: &dyn Bar);
108    |                          ^^^^^^^^ not FFI-safe
109    |
110    = note: trait objects have no C equivalent
111
112 error: `extern` block uses type `(i32, i32)`, which is not FFI-safe
113   --> $DIR/lint-ctypes.rs:61:26
114    |
115 LL |     pub fn tuple_type(p: (i32, i32));
116    |                          ^^^^^^^^^^ not FFI-safe
117    |
118    = help: consider using a struct instead
119    = note: tuples have unspecified layout
120
121 error: `extern` block uses type `(i32, i32)`, which is not FFI-safe
122   --> $DIR/lint-ctypes.rs:62:27
123    |
124 LL |     pub fn tuple_type2(p: I32Pair);
125    |                           ^^^^^^^ not FFI-safe
126    |
127    = help: consider using a struct instead
128    = note: tuples have unspecified layout
129
130 error: `extern` block uses type `ZeroSize`, which is not FFI-safe
131   --> $DIR/lint-ctypes.rs:63:25
132    |
133 LL |     pub fn zero_size(p: ZeroSize);
134    |                         ^^^^^^^^ not FFI-safe
135    |
136    = help: consider adding a member to this struct
137    = note: this struct has no fields
138 note: the type is defined here
139   --> $DIR/lint-ctypes.rs:22:1
140    |
141 LL | pub struct ZeroSize;
142    | ^^^^^^^^^^^^^^^^^^^
143
144 error: `extern` block uses type `ZeroSizeWithPhantomData`, which is not FFI-safe
145   --> $DIR/lint-ctypes.rs:64:33
146    |
147 LL |     pub fn zero_size_phantom(p: ZeroSizeWithPhantomData);
148    |                                 ^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
149    |
150    = note: composed only of `PhantomData`
151 note: the type is defined here
152   --> $DIR/lint-ctypes.rs:45:1
153    |
154 LL | pub struct ZeroSizeWithPhantomData(::std::marker::PhantomData<i32>);
155    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156
157 error: `extern` block uses type `PhantomData<bool>`, which is not FFI-safe
158   --> $DIR/lint-ctypes.rs:67:12
159    |
160 LL |         -> ::std::marker::PhantomData<bool>;
161    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
162    |
163    = note: composed only of `PhantomData`
164
165 error: `extern` block uses type `fn()`, which is not FFI-safe
166   --> $DIR/lint-ctypes.rs:68:23
167    |
168 LL |     pub fn fn_type(p: RustFn);
169    |                       ^^^^^^ not FFI-safe
170    |
171    = help: consider using an `extern fn(...) -> ...` function pointer instead
172    = note: this function pointer has Rust-specific calling convention
173
174 error: `extern` block uses type `fn()`, which is not FFI-safe
175   --> $DIR/lint-ctypes.rs:69:24
176    |
177 LL |     pub fn fn_type2(p: fn());
178    |                        ^^^^ not FFI-safe
179    |
180    = help: consider using an `extern fn(...) -> ...` function pointer instead
181    = note: this function pointer has Rust-specific calling convention
182
183 error: `extern` block uses type `Box<u32>`, which is not FFI-safe
184   --> $DIR/lint-ctypes.rs:70:28
185    |
186 LL |     pub fn fn_contained(p: RustBadRet);
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` block uses type `i128`, which is not FFI-safe
193   --> $DIR/lint-ctypes.rs:71:32
194    |
195 LL |     pub fn transparent_i128(p: TransparentI128);
196    |                                ^^^^^^^^^^^^^^^ not FFI-safe
197    |
198    = note: 128-bit integers don't currently have a known stable ABI
199
200 error: `extern` block uses type `str`, which is not FFI-safe
201   --> $DIR/lint-ctypes.rs:72:31
202    |
203 LL |     pub fn transparent_str(p: TransparentStr);
204    |                               ^^^^^^^^^^^^^^ not FFI-safe
205    |
206    = help: consider using `*const u8` and a length instead
207    = note: string slices have no C equivalent
208
209 error: `extern` block uses type `Box<u32>`, which is not FFI-safe
210   --> $DIR/lint-ctypes.rs:73:30
211    |
212 LL |     pub fn transparent_fn(p: TransparentBadFn);
213    |                              ^^^^^^^^^^^^^^^^ not FFI-safe
214    |
215    = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
216    = note: this struct has unspecified layout
217
218 error: `extern` block uses type `[u8; 8]`, which is not FFI-safe
219   --> $DIR/lint-ctypes.rs:74:27
220    |
221 LL |     pub fn raw_array(arr: [u8; 8]);
222    |                           ^^^^^^^ not FFI-safe
223    |
224    = help: consider passing a pointer to the array
225    = note: passing raw arrays by value is not FFI-safe
226
227 error: `extern` block uses type `Option<UnsafeCell<extern "C" fn()>>`, which is not FFI-safe
228   --> $DIR/lint-ctypes.rs:76:26
229    |
230 LL |     pub fn no_niche_a(a: Option<UnsafeCell<extern fn()>>);
231    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
232    |
233    = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
234    = note: enum has no representation hint
235
236 error: `extern` block uses type `Option<UnsafeCell<&i32>>`, which is not FFI-safe
237   --> $DIR/lint-ctypes.rs:78:26
238    |
239 LL |     pub fn no_niche_b(b: Option<UnsafeCell<&i32>>);
240    |                          ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
241    |
242    = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
243    = note: enum has no representation hint
244
245 error: `extern` block uses type `u128`, which is not FFI-safe
246   --> $DIR/lint-ctypes.rs:81:34
247    |
248 LL |     pub static static_u128_type: u128;
249    |                                  ^^^^ not FFI-safe
250    |
251    = note: 128-bit integers don't currently have a known stable ABI
252
253 error: `extern` block uses type `u128`, which is not FFI-safe
254   --> $DIR/lint-ctypes.rs:82:40
255    |
256 LL |     pub static static_u128_array_type: [u128; 16];
257    |                                        ^^^^^^^^^^ not FFI-safe
258    |
259    = note: 128-bit integers don't currently have a known stable ABI
260
261 error: aborting due to 27 previous errors
262