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