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