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