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