Skip to content

Commit 6c7054e

Browse files
committed
Bless ui tests.
1 parent 56063ff commit 6c7054e

File tree

3 files changed

+95
-101
lines changed

3 files changed

+95
-101
lines changed
Lines changed: 59 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
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+
120
warning: `clash` redeclared with a different signature
221
--> $DIR/clashing-extern-fn.rs:14:13
322
|
423
LL | fn clash(x: u8);
5-
| ---------------- `clash` previously declared here
24+
| --------------- `clash` previously declared here
625
...
726
LL | 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)]
1837
warning: `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

3149
warning: `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

4561
warning: `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
|
6376
LL | fn different_mod(x: u8);
64-
| ------------------------ `different_mod` previously declared here
77+
| ----------------------- `different_mod` previously declared here
6578
...
6679
LL | 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
|
7588
LL | fn variadic_decl(x: u8, ...);
76-
| ----------------------------- `variadic_decl` previously declared here
89+
| ---------------------------- `variadic_decl` previously declared here
7790
...
7891
LL | 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
|
87100
LL | fn weigh_banana(count: *const Banana) -> u64;
88-
| --------------------------------------------- `weigh_banana` previously declared here
101+
| -------------------------------------------- `weigh_banana` previously declared here
89102
...
90103
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
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
|
99112
LL | fn draw_point(p: Point);
100-
| ------------------------ `draw_point` previously declared here
113+
| ----------------------- `draw_point` previously declared here
101114
...
102115
LL | 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
|
111124
LL | fn origin() -> Point3;
112-
| ---------------------- `origin` previously declared here
125+
| --------------------- `origin` previously declared here
113126
...
114127
LL | 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
|
123136
LL | fn transparent_incorrect() -> T;
124-
| -------------------------------- `transparent_incorrect` previously declared here
137+
| ------------------------------- `transparent_incorrect` previously declared here
125138
...
126139
LL | 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
|
135148
LL | fn missing_return_type() -> usize;
136-
| ---------------------------------- `missing_return_type` previously declared here
149+
| --------------------------------- `missing_return_type` previously declared here
137150
...
138151
LL | 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
|
147160
LL | fn non_zero_usize() -> core::num::NonZeroUsize;
148-
| ----------------------------------------------- `non_zero_usize` previously declared here
161+
| ---------------------------------------------- `non_zero_usize` previously declared here
149162
...
150163
LL | 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
|
159172
LL | fn non_null_ptr() -> core::ptr::NonNull<usize>;
160-
| ----------------------------------------------- `non_null_ptr` previously declared here
173+
| ---------------------------------------------- `non_null_ptr` previously declared here
161174
...
162175
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
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
|
171184
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
173186
...
174187
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
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
|
183196
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
185198
...
186199
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
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
|
195208
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
197210
...
198211
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
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
|
207220
LL | fn hidden_niche_unsafe_cell() -> usize;
208-
| --------------------------------------- `hidden_niche_unsafe_cell` previously declared here
221+
| -------------------------------------- `hidden_niche_unsafe_cell` previously declared here
209222
...
210223
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
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-
235229
warning: 19 warnings emitted
236230

tests/ui/lint/issue-1866.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ warning: `rust_task_is_unwinding` redeclared with a different signature
22
--> $DIR/issue-1866.rs:23:13
33
|
44
LL | pub fn rust_task_is_unwinding(rt: *const rust_task) -> bool;
5-
| ------------------------------------------------------------ `rust_task_is_unwinding` previously declared here
5+
| ----------------------------------------------------------- `rust_task_is_unwinding` previously declared here
66
...
77
LL | pub fn rust_task_is_unwinding(rt: *const rust_task) -> bool;
8-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
8+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
99
|
1010
= note: expected `unsafe extern "C" fn(*const usize) -> bool`
1111
found `unsafe extern "C" fn(*const bool) -> bool`

tests/ui/lint/lint-attr-everywhere-late.stderr

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -154,40 +154,6 @@ note: the lint level is defined here
154154
LL | #[deny(missing_docs)]
155155
| ^^^^^^^^^^^^
156156

157-
error: `clashing1` redeclared with a different signature
158-
--> $DIR/lint-attr-everywhere-late.rs:123:5
159-
|
160-
LL | fn clashing1();
161-
| --------------- `clashing1` previously declared here
162-
...
163-
LL | fn clashing1(_: i32);
164-
| ^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
165-
|
166-
= note: expected `unsafe extern "C" fn()`
167-
found `unsafe extern "C" fn(i32)`
168-
note: the lint level is defined here
169-
--> $DIR/lint-attr-everywhere-late.rs:122:13
170-
|
171-
LL | #![deny(clashing_extern_declarations)]
172-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
173-
174-
error: `clashing2` redeclared with a different signature
175-
--> $DIR/lint-attr-everywhere-late.rs:128:5
176-
|
177-
LL | fn clashing2();
178-
| --------------- `clashing2` previously declared here
179-
...
180-
LL | fn clashing2(_: i32);
181-
| ^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
182-
|
183-
= note: expected `unsafe extern "C" fn()`
184-
found `unsafe extern "C" fn(i32)`
185-
note: the lint level is defined here
186-
--> $DIR/lint-attr-everywhere-late.rs:127:12
187-
|
188-
LL | #[deny(clashing_extern_declarations)]
189-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
190-
191157
error: types that do not implement `Drop` can still have drop glue, consider instead using `std::mem::needs_drop` to detect whether a type is trivially dropped
192158
--> $DIR/lint-attr-everywhere-late.rs:93:38
193159
|
@@ -436,5 +402,39 @@ note: the lint level is defined here
436402
LL | TupleStruct(#[deny(enum_intrinsics_non_enums)] discriminant::<i32>(&123));
437403
| ^^^^^^^^^^^^^^^^^^^^^^^^^
438404

405+
error: `clashing1` redeclared with a different signature
406+
--> $DIR/lint-attr-everywhere-late.rs:123:5
407+
|
408+
LL | fn clashing1();
409+
| -------------- `clashing1` previously declared here
410+
...
411+
LL | fn clashing1(_: i32);
412+
| ^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
413+
|
414+
= note: expected `unsafe extern "C" fn()`
415+
found `unsafe extern "C" fn(i32)`
416+
note: the lint level is defined here
417+
--> $DIR/lint-attr-everywhere-late.rs:122:13
418+
|
419+
LL | #![deny(clashing_extern_declarations)]
420+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
421+
422+
error: `clashing2` redeclared with a different signature
423+
--> $DIR/lint-attr-everywhere-late.rs:128:5
424+
|
425+
LL | fn clashing2();
426+
| -------------- `clashing2` previously declared here
427+
...
428+
LL | fn clashing2(_: i32);
429+
| ^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
430+
|
431+
= note: expected `unsafe extern "C" fn()`
432+
found `unsafe extern "C" fn(i32)`
433+
note: the lint level is defined here
434+
--> $DIR/lint-attr-everywhere-late.rs:127:12
435+
|
436+
LL | #[deny(clashing_extern_declarations)]
437+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
438+
439439
error: aborting due to 32 previous errors
440440

0 commit comments

Comments
 (0)