1+ warning: `extern` block uses type `Option<TransparentNoNiche>`, which is not FFI-safe
2+ --> $DIR/clashing-extern-fn.rs:433:55
3+ |
4+ LL | 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+
11+ warning: `extern` block uses type `Option<UnsafeCell<NonZeroUsize>>`, which is not FFI-safe
12+ --> $DIR/clashing-extern-fn.rs:437:46
13+ |
14+ LL | 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+
120warning: `clash` redeclared with a different signature
221 --> $DIR/clashing-extern-fn.rs:14:13
322 |
423LL | fn clash(x: u8);
5- | ---------------- `clash` previously declared here
24+ | --------------- `clash` previously declared here
625...
726LL | fn clash(x: u64);
8- | ^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
27+ | ^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
928 |
1029 = note: expected `unsafe extern "C" fn(u8)`
1130 found `unsafe extern "C" fn(u64)`
@@ -18,41 +37,35 @@ LL | #![warn(clashing_extern_declarations)]
1837warning: `extern_link_name` redeclared with a different signature
1938 --> $DIR/clashing-extern-fn.rs:52:9
2039 |
21- LL | / #[link_name = "extern_link_name"]
22- LL | | fn some_new_name(x: i16);
23- | |_____________________________- `extern_link_name` previously declared here
40+ LL | #[link_name = "extern_link_name"]
41+ | --------------------------------- `extern_link_name` previously declared here
2442...
25- LL | fn extern_link_name(x: u32);
26- | ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
43+ LL | fn extern_link_name(x: u32);
44+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
2745 |
2846 = note: expected `unsafe extern "C" fn(i16)`
2947 found `unsafe extern "C" fn(u32)`
3048
3149warning: `some_other_extern_link_name` redeclares `some_other_new_name` with a different signature
3250 --> $DIR/clashing-extern-fn.rs:55:9
3351 |
34- LL | fn some_other_new_name(x: i16);
35- | - ------------------------------ `some_other_new_name` previously declared here
52+ LL | fn some_other_new_name(x: i16);
53+ | ------------------------------ `some_other_new_name` previously declared here
3654...
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
55+ LL | #[link_name = "some_other_new_name"]
56+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
4157 |
4258 = note: expected `unsafe extern "C" fn(i16)`
4359 found `unsafe extern "C" fn(u32)`
4460
4561warning: `other_both_names_different` redeclares `link_name_same` with a different signature
4662 --> $DIR/clashing-extern-fn.rs:59:9
4763 |
48- LL | / #[link_name = "link_name_same"]
49- LL | | fn both_names_different(x: i16);
50- | |____________________________________- `link_name_same` previously declared here
64+ LL | #[link_name = "link_name_same"]
65+ | ------------------------------- `link_name_same` previously declared here
5166...
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
67+ LL | #[link_name = "link_name_same"]
68+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
5669 |
5770 = note: expected `unsafe extern "C" fn(i16)`
5871 found `unsafe extern "C" fn(u32)`
@@ -61,10 +74,10 @@ warning: `different_mod` redeclared with a different signature
6174 --> $DIR/clashing-extern-fn.rs:72:9
6275 |
6376LL | fn different_mod(x: u8);
64- | ------------------------ `different_mod` previously declared here
77+ | ----------------------- `different_mod` previously declared here
6578...
6679LL | fn different_mod(x: u64);
67- | ^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
80+ | ^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
6881 |
6982 = note: expected `unsafe extern "C" fn(u8)`
7083 found `unsafe extern "C" fn(u64)`
@@ -73,10 +86,10 @@ warning: `variadic_decl` redeclared with a different signature
7386 --> $DIR/clashing-extern-fn.rs:82:9
7487 |
7588LL | fn variadic_decl(x: u8, ...);
76- | ----------------------------- `variadic_decl` previously declared here
89+ | ---------------------------- `variadic_decl` previously declared here
7790...
7891LL | fn variadic_decl(x: u8);
79- | ^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
92+ | ^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
8093 |
8194 = note: expected `unsafe extern "C" fn(u8, ...)`
8295 found `unsafe extern "C" fn(u8)`
@@ -85,10 +98,10 @@ warning: `weigh_banana` redeclared with a different signature
8598 --> $DIR/clashing-extern-fn.rs:142:13
8699 |
87100LL | fn weigh_banana(count: *const Banana) -> u64;
88- | --------------------------------------------- `weigh_banana` previously declared here
101+ | -------------------------------------------- `weigh_banana` previously declared here
89102...
90103LL | fn weigh_banana(count: *const Banana) -> u64;
91- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
104+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
92105 |
93106 = note: expected `unsafe extern "C" fn(*const one::Banana) -> u64`
94107 found `unsafe extern "C" fn(*const three::Banana) -> u64`
@@ -97,10 +110,10 @@ warning: `draw_point` redeclared with a different signature
97110 --> $DIR/clashing-extern-fn.rs:171:13
98111 |
99112LL | fn draw_point(p: Point);
100- | ------------------------ `draw_point` previously declared here
113+ | ----------------------- `draw_point` previously declared here
101114...
102115LL | fn draw_point(p: Point);
103- | ^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
116+ | ^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
104117 |
105118 = note: expected `unsafe extern "C" fn(sameish_members::a::Point)`
106119 found `unsafe extern "C" fn(sameish_members::b::Point)`
@@ -109,10 +122,10 @@ warning: `origin` redeclared with a different signature
109122 --> $DIR/clashing-extern-fn.rs:197:13
110123 |
111124LL | fn origin() -> Point3;
112- | ---------------------- `origin` previously declared here
125+ | --------------------- `origin` previously declared here
113126...
114127LL | fn origin() -> Point3;
115- | ^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
128+ | ^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
116129 |
117130 = note: expected `unsafe extern "C" fn() -> same_sized_members_clash::a::Point3`
118131 found `unsafe extern "C" fn() -> same_sized_members_clash::b::Point3`
@@ -121,10 +134,10 @@ warning: `transparent_incorrect` redeclared with a different signature
121134 --> $DIR/clashing-extern-fn.rs:220:13
122135 |
123136LL | fn transparent_incorrect() -> T;
124- | -------------------------------- `transparent_incorrect` previously declared here
137+ | ------------------------------- `transparent_incorrect` previously declared here
125138...
126139LL | fn transparent_incorrect() -> isize;
127- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
140+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
128141 |
129142 = note: expected `unsafe extern "C" fn() -> T`
130143 found `unsafe extern "C" fn() -> isize`
@@ -133,10 +146,10 @@ warning: `missing_return_type` redeclared with a different signature
133146 --> $DIR/clashing-extern-fn.rs:259:13
134147 |
135148LL | fn missing_return_type() -> usize;
136- | ---------------------------------- `missing_return_type` previously declared here
149+ | --------------------------------- `missing_return_type` previously declared here
137150...
138151LL | fn missing_return_type();
139- | ^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
152+ | ^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
140153 |
141154 = note: expected `unsafe extern "C" fn() -> usize`
142155 found `unsafe extern "C" fn()`
@@ -145,10 +158,10 @@ warning: `non_zero_usize` redeclared with a different signature
145158 --> $DIR/clashing-extern-fn.rs:277:13
146159 |
147160LL | fn non_zero_usize() -> core::num::NonZeroUsize;
148- | ----------------------------------------------- `non_zero_usize` previously declared here
161+ | ---------------------------------------------- `non_zero_usize` previously declared here
149162...
150163LL | fn non_zero_usize() -> usize;
151- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
164+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
152165 |
153166 = note: expected `unsafe extern "C" fn() -> NonZeroUsize`
154167 found `unsafe extern "C" fn() -> usize`
@@ -157,10 +170,10 @@ warning: `non_null_ptr` redeclared with a different signature
157170 --> $DIR/clashing-extern-fn.rs:279:13
158171 |
159172LL | fn non_null_ptr() -> core::ptr::NonNull<usize>;
160- | ----------------------------------------------- `non_null_ptr` previously declared here
173+ | ---------------------------------------------- `non_null_ptr` previously declared here
161174...
162175LL | fn non_null_ptr() -> *const usize;
163- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
176+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
164177 |
165178 = note: expected `unsafe extern "C" fn() -> NonNull<usize>`
166179 found `unsafe extern "C" fn() -> *const usize`
@@ -169,10 +182,10 @@ warning: `option_non_zero_usize_incorrect` redeclared with a different signature
169182 --> $DIR/clashing-extern-fn.rs:377:13
170183 |
171184LL | fn option_non_zero_usize_incorrect() -> usize;
172- | ---------------------------------------------- `option_non_zero_usize_incorrect` previously declared here
185+ | --------------------------------------------- `option_non_zero_usize_incorrect` previously declared here
173186...
174187LL | fn option_non_zero_usize_incorrect() -> isize;
175- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
188+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
176189 |
177190 = note: expected `unsafe extern "C" fn() -> usize`
178191 found `unsafe extern "C" fn() -> isize`
@@ -181,10 +194,10 @@ warning: `option_non_null_ptr_incorrect` redeclared with a different signature
181194 --> $DIR/clashing-extern-fn.rs:379:13
182195 |
183196LL | fn option_non_null_ptr_incorrect() -> *const usize;
184- | --------------------------------------------------- `option_non_null_ptr_incorrect` previously declared here
197+ | -------------------------------------------------- `option_non_null_ptr_incorrect` previously declared here
185198...
186199LL | fn option_non_null_ptr_incorrect() -> *const isize;
187- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
200+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
188201 |
189202 = note: expected `unsafe extern "C" fn() -> *const usize`
190203 found `unsafe extern "C" fn() -> *const isize`
@@ -193,10 +206,10 @@ warning: `hidden_niche_transparent_no_niche` redeclared with a different signatu
193206 --> $DIR/clashing-extern-fn.rs:433:13
194207 |
195208LL | fn hidden_niche_transparent_no_niche() -> usize;
196- | ------------------------------------------------ `hidden_niche_transparent_no_niche` previously declared here
209+ | ----------------------------------------------- `hidden_niche_transparent_no_niche` previously declared here
197210...
198211LL | fn hidden_niche_transparent_no_niche() -> Option<TransparentNoNiche>;
199- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
212+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
200213 |
201214 = note: expected `unsafe extern "C" fn() -> usize`
202215 found `unsafe extern "C" fn() -> Option<TransparentNoNiche>`
@@ -205,32 +218,13 @@ warning: `hidden_niche_unsafe_cell` redeclared with a different signature
205218 --> $DIR/clashing-extern-fn.rs:437:13
206219 |
207220LL | fn hidden_niche_unsafe_cell() -> usize;
208- | --------------------------------------- `hidden_niche_unsafe_cell` previously declared here
221+ | -------------------------------------- `hidden_niche_unsafe_cell` previously declared here
209222...
210223LL | fn hidden_niche_unsafe_cell() -> Option<UnsafeCell<NonZeroUsize>>;
211- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
224+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
212225 |
213226 = note: expected `unsafe extern "C" fn() -> usize`
214227 found `unsafe extern "C" fn() -> Option<UnsafeCell<NonZeroUsize>>`
215228
216- warning: `extern` block uses type `Option<TransparentNoNiche>`, which is not FFI-safe
217- --> $DIR/clashing-extern-fn.rs:433:55
218- |
219- LL | fn hidden_niche_transparent_no_niche() -> Option<TransparentNoNiche>;
220- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
221- |
222- = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
223- = note: enum has no representation hint
224- = note: `#[warn(improper_ctypes)]` on by default
225-
226- warning: `extern` block uses type `Option<UnsafeCell<NonZeroUsize>>`, which is not FFI-safe
227- --> $DIR/clashing-extern-fn.rs:437:46
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-
235229warning: 19 warnings emitted
236230
0 commit comments