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