1
1
warning: `clash` redeclared with a different signature
2
- --> $DIR/clashing-extern-fn.rs:14 :13
2
+ --> $DIR/clashing-extern-fn.rs:15 :13
3
3
|
4
4
LL | fn clash(x: u8);
5
5
| ---------------- `clash` previously declared here
@@ -8,15 +8,15 @@ LL | fn clash(x: u64);
8
8
| ^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
9
9
|
10
10
note: the lint level is defined here
11
- --> $DIR/clashing-extern-fn.rs:4 :9
11
+ --> $DIR/clashing-extern-fn.rs:5 :9
12
12
|
13
13
LL | #![warn(clashing_extern_declarations)]
14
14
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15
15
= note: expected `unsafe extern "C" fn(u8)`
16
16
found `unsafe extern "C" fn(u64)`
17
17
18
18
warning: `extern_link_name` redeclared with a different signature
19
- --> $DIR/clashing-extern-fn.rs:52 :9
19
+ --> $DIR/clashing-extern-fn.rs:53 :9
20
20
|
21
21
LL | / #[link_name = "extern_link_name"]
22
22
LL | | fn some_new_name(x: i16);
@@ -29,7 +29,7 @@ LL | fn extern_link_name(x: u32);
29
29
found `unsafe extern "C" fn(u32)`
30
30
31
31
warning: `some_other_extern_link_name` redeclares `some_other_new_name` with a different signature
32
- --> $DIR/clashing-extern-fn.rs:55 :9
32
+ --> $DIR/clashing-extern-fn.rs:56 :9
33
33
|
34
34
LL | fn some_other_new_name(x: i16);
35
35
| ------------------------------- `some_other_new_name` previously declared here
@@ -43,7 +43,7 @@ LL | | fn some_other_extern_link_name(x: u32);
43
43
found `unsafe extern "C" fn(u32)`
44
44
45
45
warning: `other_both_names_different` redeclares `link_name_same` with a different signature
46
- --> $DIR/clashing-extern-fn.rs:59 :9
46
+ --> $DIR/clashing-extern-fn.rs:60 :9
47
47
|
48
48
LL | / #[link_name = "link_name_same"]
49
49
LL | | fn both_names_different(x: i16);
@@ -58,7 +58,7 @@ LL | | fn other_both_names_different(x: u32);
58
58
found `unsafe extern "C" fn(u32)`
59
59
60
60
warning: `different_mod` redeclared with a different signature
61
- --> $DIR/clashing-extern-fn.rs:72 :9
61
+ --> $DIR/clashing-extern-fn.rs:73 :9
62
62
|
63
63
LL | fn different_mod(x: u8);
64
64
| ------------------------ `different_mod` previously declared here
@@ -70,7 +70,7 @@ LL | fn different_mod(x: u64);
70
70
found `unsafe extern "C" fn(u64)`
71
71
72
72
warning: `variadic_decl` redeclared with a different signature
73
- --> $DIR/clashing-extern-fn.rs:82 :9
73
+ --> $DIR/clashing-extern-fn.rs:83 :9
74
74
|
75
75
LL | fn variadic_decl(x: u8, ...);
76
76
| ----------------------------- `variadic_decl` previously declared here
@@ -82,7 +82,7 @@ LL | fn variadic_decl(x: u8);
82
82
found `unsafe extern "C" fn(u8)`
83
83
84
84
warning: `weigh_banana` redeclared with a different signature
85
- --> $DIR/clashing-extern-fn.rs:142 :13
85
+ --> $DIR/clashing-extern-fn.rs:143 :13
86
86
|
87
87
LL | fn weigh_banana(count: *const Banana) -> u64;
88
88
| --------------------------------------------- `weigh_banana` previously declared here
@@ -94,7 +94,7 @@ LL | fn weigh_banana(count: *const Banana) -> u64;
94
94
found `unsafe extern "C" fn(*const three::Banana) -> u64`
95
95
96
96
warning: `draw_point` redeclared with a different signature
97
- --> $DIR/clashing-extern-fn.rs:171 :13
97
+ --> $DIR/clashing-extern-fn.rs:172 :13
98
98
|
99
99
LL | fn draw_point(p: Point);
100
100
| ------------------------ `draw_point` previously declared here
@@ -106,7 +106,7 @@ LL | fn draw_point(p: Point);
106
106
found `unsafe extern "C" fn(sameish_members::b::Point)`
107
107
108
108
warning: `origin` redeclared with a different signature
109
- --> $DIR/clashing-extern-fn.rs:197 :13
109
+ --> $DIR/clashing-extern-fn.rs:198 :13
110
110
|
111
111
LL | fn origin() -> Point3;
112
112
| ---------------------- `origin` previously declared here
@@ -118,7 +118,7 @@ LL | fn origin() -> Point3;
118
118
found `unsafe extern "C" fn() -> same_sized_members_clash::b::Point3`
119
119
120
120
warning: `transparent_incorrect` redeclared with a different signature
121
- --> $DIR/clashing-extern-fn.rs:220 :13
121
+ --> $DIR/clashing-extern-fn.rs:221 :13
122
122
|
123
123
LL | fn transparent_incorrect() -> T;
124
124
| -------------------------------- `transparent_incorrect` previously declared here
@@ -130,7 +130,7 @@ LL | fn transparent_incorrect() -> isize;
130
130
found `unsafe extern "C" fn() -> isize`
131
131
132
132
warning: `missing_return_type` redeclared with a different signature
133
- --> $DIR/clashing-extern-fn.rs:238 :13
133
+ --> $DIR/clashing-extern-fn.rs:239 :13
134
134
|
135
135
LL | fn missing_return_type() -> usize;
136
136
| ---------------------------------- `missing_return_type` previously declared here
@@ -142,7 +142,7 @@ LL | fn missing_return_type();
142
142
found `unsafe extern "C" fn()`
143
143
144
144
warning: `non_zero_usize` redeclared with a different signature
145
- --> $DIR/clashing-extern-fn.rs:256 :13
145
+ --> $DIR/clashing-extern-fn.rs:257 :13
146
146
|
147
147
LL | fn non_zero_usize() -> core::num::NonZeroUsize;
148
148
| ----------------------------------------------- `non_zero_usize` previously declared here
@@ -154,7 +154,7 @@ LL | fn non_zero_usize() -> usize;
154
154
found `unsafe extern "C" fn() -> usize`
155
155
156
156
warning: `non_null_ptr` redeclared with a different signature
157
- --> $DIR/clashing-extern-fn.rs:258 :13
157
+ --> $DIR/clashing-extern-fn.rs:259 :13
158
158
|
159
159
LL | fn non_null_ptr() -> core::ptr::NonNull<usize>;
160
160
| ----------------------------------------------- `non_null_ptr` previously declared here
@@ -166,7 +166,7 @@ LL | fn non_null_ptr() -> *const usize;
166
166
found `unsafe extern "C" fn() -> *const usize`
167
167
168
168
warning: `option_non_zero_usize_incorrect` redeclared with a different signature
169
- --> $DIR/clashing-extern-fn.rs:356 :13
169
+ --> $DIR/clashing-extern-fn.rs:357 :13
170
170
|
171
171
LL | fn option_non_zero_usize_incorrect() -> usize;
172
172
| ---------------------------------------------- `option_non_zero_usize_incorrect` previously declared here
@@ -178,7 +178,7 @@ LL | fn option_non_zero_usize_incorrect() -> isize;
178
178
found `unsafe extern "C" fn() -> isize`
179
179
180
180
warning: `option_non_null_ptr_incorrect` redeclared with a different signature
181
- --> $DIR/clashing-extern-fn.rs:358 :13
181
+ --> $DIR/clashing-extern-fn.rs:359 :13
182
182
|
183
183
LL | fn option_non_null_ptr_incorrect() -> *const usize;
184
184
| --------------------------------------------------- `option_non_null_ptr_incorrect` previously declared here
@@ -189,5 +189,48 @@ LL | fn option_non_null_ptr_incorrect() -> *const isize;
189
189
= note: expected `unsafe extern "C" fn() -> *const usize`
190
190
found `unsafe extern "C" fn() -> *const isize`
191
191
192
- warning: 15 warnings emitted
192
+ warning: `hidden_niche_transparent_no_niche` redeclared with a different signature
193
+ --> $DIR/clashing-extern-fn.rs:410:13
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
205
+ --> $DIR/clashing-extern-fn.rs:414:13
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
217
+ --> $DIR/clashing-extern-fn.rs:410:55
218
+ |
219
+ LL | fn hidden_niche_transparent_no_niche() -> Option<TransparentNoNiche>;
220
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
221
+ |
222
+ = note: `#[warn(improper_ctypes)]` on by default
223
+ = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
224
+ = note: enum has no representation hint
225
+
226
+ warning: `extern` block uses type `Option<UnsafeCell<NonZeroUsize>>`, which is not FFI-safe
227
+ --> $DIR/clashing-extern-fn.rs:414: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
+
235
+ warning: 19 warnings emitted
193
236
0 commit comments