fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
10.2 KiB230 linesraw
1warning: `extern` block uses type `Option<TransparentNoNiche>`, which is not FFI-safe
2  --> $DIR/clashing-extern-fn.rs:433:55
3   |
4LL |             fn hidden_niche_transparent_no_niche() -> Option<TransparentNoNiche>;
5   |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
6   |
7   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
8   = note: enum has no representation hint
9   = note: `#[warn(improper_ctypes)]` on by default
10
11warning: `extern` block uses type `Option<UnsafeCell<NonZeroUsize>>`, which is not FFI-safe
12  --> $DIR/clashing-extern-fn.rs:437:46
13   |
14LL |             fn hidden_niche_unsafe_cell() -> Option<UnsafeCell<NonZeroUsize>>;
15   |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
16   |
17   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
18   = note: enum has no representation hint
19
20warning: `clash` redeclared with a different signature
21  --> $DIR/clashing-extern-fn.rs:14:13
22   |
23LL |             fn clash(x: u8);
24   |             --------------- `clash` previously declared here
25...
26LL |             fn clash(x: u64);
27   |             ^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
28   |
29   = note: expected `unsafe extern "C" fn(u8)`
30              found `unsafe extern "C" fn(u64)`
31note: the lint level is defined here
32  --> $DIR/clashing-extern-fn.rs:4:9
33   |
34LL | #![warn(clashing_extern_declarations)]
35   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36
37warning: `extern_link_name` redeclared with a different signature
38  --> $DIR/clashing-extern-fn.rs:52:9
39   |
40LL |     #[link_name = "extern_link_name"]
41   |     --------------------------------- `extern_link_name` previously declared here
42...
43LL |         fn extern_link_name(x: u32);
44   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
45   |
46   = note: expected `unsafe extern "C" fn(i16)`
47              found `unsafe extern "C" fn(u32)`
48
49warning: `some_other_extern_link_name` redeclares `some_other_new_name` with a different signature
50  --> $DIR/clashing-extern-fn.rs:55:9
51   |
52LL |     fn some_other_new_name(x: i16);
53   |     ------------------------------ `some_other_new_name` previously declared here
54...
55LL |         #[link_name = "some_other_new_name"]
56   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
57   |
58   = note: expected `unsafe extern "C" fn(i16)`
59              found `unsafe extern "C" fn(u32)`
60
61warning: `other_both_names_different` redeclares `link_name_same` with a different signature
62  --> $DIR/clashing-extern-fn.rs:59:9
63   |
64LL |     #[link_name = "link_name_same"]
65   |     ------------------------------- `link_name_same` previously declared here
66...
67LL |         #[link_name = "link_name_same"]
68   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
69   |
70   = note: expected `unsafe extern "C" fn(i16)`
71              found `unsafe extern "C" fn(u32)`
72
73warning: `different_mod` redeclared with a different signature
74  --> $DIR/clashing-extern-fn.rs:72:9
75   |
76LL |         fn different_mod(x: u8);
77   |         ----------------------- `different_mod` previously declared here
78...
79LL |         fn different_mod(x: u64);
80   |         ^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
81   |
82   = note: expected `unsafe extern "C" fn(u8)`
83              found `unsafe extern "C" fn(u64)`
84
85warning: `variadic_decl` redeclared with a different signature
86  --> $DIR/clashing-extern-fn.rs:82:9
87   |
88LL |     fn variadic_decl(x: u8, ...);
89   |     ---------------------------- `variadic_decl` previously declared here
90...
91LL |         fn variadic_decl(x: u8);
92   |         ^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
93   |
94   = note: expected `unsafe extern "C" fn(u8, ...)`
95              found `unsafe extern "C" fn(u8)`
96
97warning: `weigh_banana` redeclared with a different signature
98  --> $DIR/clashing-extern-fn.rs:142:13
99   |
100LL |             fn weigh_banana(count: *const Banana) -> u64;
101   |             -------------------------------------------- `weigh_banana` previously declared here
102...
103LL |             fn weigh_banana(count: *const Banana) -> u64;
104   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
105   |
106   = note: expected `unsafe extern "C" fn(*const one::Banana) -> u64`
107              found `unsafe extern "C" fn(*const three::Banana) -> u64`
108
109warning: `draw_point` redeclared with a different signature
110  --> $DIR/clashing-extern-fn.rs:171:13
111   |
112LL |             fn draw_point(p: Point);
113   |             ----------------------- `draw_point` previously declared here
114...
115LL |             fn draw_point(p: Point);
116   |             ^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
117   |
118   = note: expected `unsafe extern "C" fn(sameish_members::a::Point)`
119              found `unsafe extern "C" fn(sameish_members::b::Point)`
120
121warning: `origin` redeclared with a different signature
122  --> $DIR/clashing-extern-fn.rs:197:13
123   |
124LL |             fn origin() -> Point3;
125   |             --------------------- `origin` previously declared here
126...
127LL |             fn origin() -> Point3;
128   |             ^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
129   |
130   = note: expected `unsafe extern "C" fn() -> same_sized_members_clash::a::Point3`
131              found `unsafe extern "C" fn() -> same_sized_members_clash::b::Point3`
132
133warning: `transparent_incorrect` redeclared with a different signature
134  --> $DIR/clashing-extern-fn.rs:220:13
135   |
136LL |             fn transparent_incorrect() -> T;
137   |             ------------------------------- `transparent_incorrect` previously declared here
138...
139LL |             fn transparent_incorrect() -> isize;
140   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
141   |
142   = note: expected `unsafe extern "C" fn() -> T`
143              found `unsafe extern "C" fn() -> isize`
144
145warning: `missing_return_type` redeclared with a different signature
146  --> $DIR/clashing-extern-fn.rs:259:13
147   |
148LL |             fn missing_return_type() -> usize;
149   |             --------------------------------- `missing_return_type` previously declared here
150...
151LL |             fn missing_return_type();
152   |             ^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
153   |
154   = note: expected `unsafe extern "C" fn() -> usize`
155              found `unsafe extern "C" fn()`
156
157warning: `non_zero_usize` redeclared with a different signature
158  --> $DIR/clashing-extern-fn.rs:277:13
159   |
160LL |             fn non_zero_usize() -> core::num::NonZeroUsize;
161   |             ---------------------------------------------- `non_zero_usize` previously declared here
162...
163LL |             fn non_zero_usize() -> usize;
164   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
165   |
166   = note: expected `unsafe extern "C" fn() -> NonZeroUsize`
167              found `unsafe extern "C" fn() -> usize`
168
169warning: `non_null_ptr` redeclared with a different signature
170  --> $DIR/clashing-extern-fn.rs:279:13
171   |
172LL |             fn non_null_ptr() -> core::ptr::NonNull<usize>;
173   |             ---------------------------------------------- `non_null_ptr` previously declared here
174...
175LL |             fn non_null_ptr() -> *const usize;
176   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
177   |
178   = note: expected `unsafe extern "C" fn() -> NonNull<usize>`
179              found `unsafe extern "C" fn() -> *const usize`
180
181warning: `option_non_zero_usize_incorrect` redeclared with a different signature
182  --> $DIR/clashing-extern-fn.rs:377:13
183   |
184LL |             fn option_non_zero_usize_incorrect() -> usize;
185   |             --------------------------------------------- `option_non_zero_usize_incorrect` previously declared here
186...
187LL |             fn option_non_zero_usize_incorrect() -> isize;
188   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
189   |
190   = note: expected `unsafe extern "C" fn() -> usize`
191              found `unsafe extern "C" fn() -> isize`
192
193warning: `option_non_null_ptr_incorrect` redeclared with a different signature
194  --> $DIR/clashing-extern-fn.rs:379:13
195   |
196LL |             fn option_non_null_ptr_incorrect() -> *const usize;
197   |             -------------------------------------------------- `option_non_null_ptr_incorrect` previously declared here
198...
199LL |             fn option_non_null_ptr_incorrect() -> *const isize;
200   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
201   |
202   = note: expected `unsafe extern "C" fn() -> *const usize`
203              found `unsafe extern "C" fn() -> *const isize`
204
205warning: `hidden_niche_transparent_no_niche` redeclared with a different signature
206  --> $DIR/clashing-extern-fn.rs:433:13
207   |
208LL |             fn hidden_niche_transparent_no_niche() -> usize;
209   |             ----------------------------------------------- `hidden_niche_transparent_no_niche` previously declared here
210...
211LL |             fn hidden_niche_transparent_no_niche() -> Option<TransparentNoNiche>;
212   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
213   |
214   = note: expected `unsafe extern "C" fn() -> usize`
215              found `unsafe extern "C" fn() -> Option<TransparentNoNiche>`
216
217warning: `hidden_niche_unsafe_cell` redeclared with a different signature
218  --> $DIR/clashing-extern-fn.rs:437:13
219   |
220LL |             fn hidden_niche_unsafe_cell() -> usize;
221   |             -------------------------------------- `hidden_niche_unsafe_cell` previously declared here
222...
223LL |             fn hidden_niche_unsafe_cell() -> Option<UnsafeCell<NonZeroUsize>>;
224   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
225   |
226   = note: expected `unsafe extern "C" fn() -> usize`
227              found `unsafe extern "C" fn() -> Option<UnsafeCell<NonZeroUsize>>`
228
229warning: 19 warnings emitted
230