Skip to content

Commit 3e36dc2

Browse files
committed
rebless tests
1 parent 1c5e290 commit 3e36dc2

File tree

113 files changed

+489
-363
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+489
-363
lines changed

tests/ui/asm/x86_64/type-check-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn main() {
6464
let mut r = &mut 0;
6565
asm!("{}", in(reg) f);
6666
asm!("{}", inout(reg) f);
67-
//~^ ERROR cannot use value of type `fn() {main}` for inline assembly
67+
//~^ ERROR cannot use value of type `{fn item main: fn()}` for inline assembly
6868
asm!("{}", in(reg) r);
6969
asm!("{}", inout(reg) r);
7070
//~^ ERROR cannot use value of type `&mut i32` for inline assembly

tests/ui/asm/x86_64/type-check-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ LL | asm!("{}", in(reg) [1, 2, 3]);
6363
|
6464
= note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
6565

66-
error: cannot use value of type `fn() {main}` for inline assembly
66+
error: cannot use value of type `{fn item main: fn()}` for inline assembly
6767
--> $DIR/type-check-2.rs:66:31
6868
|
6969
LL | asm!("{}", inout(reg) f);

tests/ui/associated-types/substs-ppaux.normal.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>;
1010
| expected due to this
1111
|
1212
= note: expected unit type `()`
13-
found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}`
13+
found fn item `{fn item <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>: fn()}`
1414
help: use parentheses to call this associated function
1515
|
1616
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>();
@@ -28,7 +28,7 @@ LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>;
2828
| expected due to this
2929
|
3030
= note: expected unit type `()`
31-
found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}`
31+
found fn item `{fn item <i8 as Foo<'static, 'static>>::bar::<'static, char>: fn()}`
3232
help: use parentheses to call this associated function
3333
|
3434
LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>();
@@ -46,7 +46,7 @@ LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz;
4646
| expected due to this
4747
|
4848
= note: expected unit type `()`
49-
found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}`
49+
found fn item `{fn item <i8 as Foo<'static, 'static, u8>>::baz: fn()}`
5050
help: use parentheses to call this associated function
5151
|
5252
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz();
@@ -64,7 +64,7 @@ LL | let x: () = foo::<'static>;
6464
| expected due to this
6565
|
6666
= note: expected unit type `()`
67-
found fn item `fn() {foo::<'static>}`
67+
found fn item `{fn item foo::<'static>: fn()}`
6868
help: use parentheses to call this function
6969
|
7070
LL | let x: () = foo::<'static>();

tests/ui/associated-types/substs-ppaux.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,35 @@ fn foo<'z>() where &'z (): Sized {
1616
let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>;
1717
//[verbose]~^ ERROR mismatched types
1818
//[verbose]~| expected unit type `()`
19-
//[verbose]~| found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::bar::<ReStatic, char>}`
19+
//[verbose]~| found fn item `{fn item <i8 as Foo<ReStatic, ReStatic, u8>>::bar::<ReStatic, char>: fn()}`
2020
//[normal]~^^^^ ERROR mismatched types
2121
//[normal]~| expected unit type `()`
22-
//[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}`
22+
//[normal]~| found fn item `{fn item <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>: fn()}`
2323

2424

2525
let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>;
2626
//[verbose]~^ ERROR mismatched types
2727
//[verbose]~| expected unit type `()`
28-
//[verbose]~| found fn item `fn() {<i8 as Foo<ReStatic, ReStatic>>::bar::<ReStatic, char>}`
28+
//[verbose]~| found fn item `{fn item <i8 as Foo<ReStatic, ReStatic>>::bar::<ReStatic, char>: fn()}`
2929
//[normal]~^^^^ ERROR mismatched types
3030
//[normal]~| expected unit type `()`
31-
//[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}`
31+
//[normal]~| found fn item `{fn item <i8 as Foo<'static, 'static>>::bar::<'static, char>: fn()}`
3232

3333
let x: () = <i8 as Foo<'static, 'static, u8>>::baz;
3434
//[verbose]~^ ERROR mismatched types
3535
//[verbose]~| expected unit type `()`
36-
//[verbose]~| found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::baz}`
36+
//[verbose]~| found fn item `{fn item <i8 as Foo<ReStatic, ReStatic, u8>>::baz: fn()}`
3737
//[normal]~^^^^ ERROR mismatched types
3838
//[normal]~| expected unit type `()`
39-
//[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}`
39+
//[normal]~| found fn item `{fn item <i8 as Foo<'static, 'static, u8>>::baz: fn()}`
4040

4141
let x: () = foo::<'static>;
4242
//[verbose]~^ ERROR mismatched types
4343
//[verbose]~| expected unit type `()`
44-
//[verbose]~| found fn item `fn() {foo::<ReStatic>}`
44+
//[verbose]~| found fn item `{fn item foo::<ReStatic>: fn()}`
4545
//[normal]~^^^^ ERROR mismatched types
4646
//[normal]~| expected unit type `()`
47-
//[normal]~| found fn item `fn() {foo::<'static>}`
47+
//[normal]~| found fn item `{fn item foo::<'static>: fn()}`
4848

4949
<str as Foo<u8>>::bar;
5050
//[verbose]~^ ERROR the size for values of type

tests/ui/associated-types/substs-ppaux.verbose.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>;
1010
| expected due to this
1111
|
1212
= note: expected unit type `()`
13-
found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::bar::<ReStatic, char>}`
13+
found fn item `{fn item <i8 as Foo<ReStatic, ReStatic, u8>>::bar::<ReStatic, char>: fn()}`
1414
help: use parentheses to call this associated function
1515
|
1616
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>();
@@ -28,7 +28,7 @@ LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>;
2828
| expected due to this
2929
|
3030
= note: expected unit type `()`
31-
found fn item `fn() {<i8 as Foo<ReStatic, ReStatic>>::bar::<ReStatic, char>}`
31+
found fn item `{fn item <i8 as Foo<ReStatic, ReStatic>>::bar::<ReStatic, char>: fn()}`
3232
help: use parentheses to call this associated function
3333
|
3434
LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>();
@@ -46,7 +46,7 @@ LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz;
4646
| expected due to this
4747
|
4848
= note: expected unit type `()`
49-
found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::baz}`
49+
found fn item `{fn item <i8 as Foo<ReStatic, ReStatic, u8>>::baz: fn()}`
5050
help: use parentheses to call this associated function
5151
|
5252
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz();
@@ -64,7 +64,7 @@ LL | let x: () = foo::<'static>;
6464
| expected due to this
6565
|
6666
= note: expected unit type `()`
67-
found fn item `fn() {foo::<ReStatic>}`
67+
found fn item `{fn item foo::<ReStatic>: fn()}`
6868
help: use parentheses to call this function
6969
|
7070
LL | let x: () = foo::<'static>();

tests/ui/async-await/drop-tracking-unresolved-typeck-results.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | | Next(&Buffered(Map(Empty(PhantomData), ready::<&()>), FuturesOrde
88
LL | | });
99
| |______^ implementation of `FnOnce` is not general enough
1010
|
11-
= note: `fn(&'0 ()) -> std::future::Ready<&'0 ()> {std::future::ready::<&'0 ()>}` must implement `FnOnce<(&'1 (),)>`, for any two lifetimes `'0` and `'1`...
11+
= note: `{fn item std::future::ready::<&'0 ()>: fn(&'0 ()) -> std::future::Ready<&'0 ()>}` must implement `FnOnce<(&'1 (),)>`, for any two lifetimes `'0` and `'1`...
1212
= note: ...but it actually implements `FnOnce<(&(),)>`
1313

1414
error: implementation of `FnOnce` is not general enough
@@ -21,7 +21,7 @@ LL | | Next(&Buffered(Map(Empty(PhantomData), ready::<&()>), FuturesOrde
2121
LL | | });
2222
| |______^ implementation of `FnOnce` is not general enough
2323
|
24-
= note: `fn(&'0 ()) -> std::future::Ready<&'0 ()> {std::future::ready::<&'0 ()>}` must implement `FnOnce<(&'1 (),)>`, for any two lifetimes `'0` and `'1`...
24+
= note: `{fn item std::future::ready::<&'0 ()>: fn(&'0 ()) -> std::future::Ready<&'0 ()>}` must implement `FnOnce<(&'1 (),)>`, for any two lifetimes `'0` and `'1`...
2525
= note: ...but it actually implements `FnOnce<(&(),)>`
2626
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2727

tests/ui/binop/issue-77910-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ fn main() {
77
// we shouldn't ice with the bound var here.
88
assert_eq!(foo, y);
99
//~^ ERROR binary operation `==` cannot be applied to type
10-
//~| ERROR `for<'a> fn(&'a i32) -> &'a i32 {foo}` doesn't implement `Debug`
10+
//~| ERROR `{fn item foo: for<'a> fn(&'a i32) -> &'a i32}` doesn't implement `Debug`
1111
}

tests/ui/binop/issue-77910-1.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
error[E0369]: binary operation `==` cannot be applied to type `for<'a> fn(&'a i32) -> &'a i32 {foo}`
1+
error[E0369]: binary operation `==` cannot be applied to type `{fn item foo: for<'a> fn(&'a i32) -> &'a i32}`
22
--> $DIR/issue-77910-1.rs:8:5
33
|
44
LL | assert_eq!(foo, y);
55
| ^^^^^^^^^^^^^^^^^^
66
| |
7-
| for<'a> fn(&'a i32) -> &'a i32 {foo}
7+
| {fn item foo: for<'a> fn(&'a i32) -> &'a i32}
88
| _
99
|
1010
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
1111

12-
error[E0277]: `for<'a> fn(&'a i32) -> &'a i32 {foo}` doesn't implement `Debug`
12+
error[E0277]: `{fn item foo: for<'a> fn(&'a i32) -> &'a i32}` doesn't implement `Debug`
1313
--> $DIR/issue-77910-1.rs:8:5
1414
|
1515
LL | fn foo(s: &i32) -> &i32 {
1616
| --- consider calling this function
1717
...
1818
LL | assert_eq!(foo, y);
19-
| ^^^^^^^^^^^^^^^^^^ `for<'a> fn(&'a i32) -> &'a i32 {foo}` cannot be formatted using `{:?}` because it doesn't implement `Debug`
19+
| ^^^^^^^^^^^^^^^^^^ `{fn item foo: for<'a> fn(&'a i32) -> &'a i32}` cannot be formatted using `{:?}` because it doesn't implement `Debug`
2020
|
21-
= help: the trait `Debug` is not implemented for fn item `for<'a> fn(&'a i32) -> &'a i32 {foo}`
21+
= help: the trait `Debug` is not implemented for fn item `{fn item foo: for<'a> fn(&'a i32) -> &'a i32}`
2222
= help: use parentheses to call this function: `foo(/* &i32 */)`
2323
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
2424

tests/ui/binop/issue-77910-2.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error[E0369]: binary operation `==` cannot be applied to type `for<'a> fn(&'a i32) -> &'a i32 {foo}`
1+
error[E0369]: binary operation `==` cannot be applied to type `{fn item foo: for<'a> fn(&'a i32) -> &'a i32}`
22
--> $DIR/issue-77910-2.rs:7:12
33
|
44
LL | if foo == y {}
55
| --- ^^ - _
66
| |
7-
| for<'a> fn(&'a i32) -> &'a i32 {foo}
7+
| {fn item foo: for<'a> fn(&'a i32) -> &'a i32}
88
|
99
help: use parentheses to call this function
1010
|

tests/ui/c-variadic/issue-32201.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ fn bar(_: *const u8) {}
77
fn main() {
88
unsafe {
99
foo(0, bar);
10-
//~^ ERROR can't pass `fn(*const u8) {bar}` to variadic function
11-
//~| HELP cast the value to `fn(*const u8)`
10+
//~^ ERROR can't pass `{fn item bar: fn(*const u8)}` to variadic function
11+
//~| HELP a function item is zero-sized and needs to be casted into a function pointer to be used in FFI
12+
//~| HELP cast the value into a function pointer
13+
//~| HELP cast the value to `fn(*const u8)
1214
}
1315
}

tests/ui/c-variadic/issue-32201.stderr

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1-
error[E0617]: can't pass `fn(*const u8) {bar}` to variadic function
1+
error[E0617]: can't pass `{fn item bar: fn(*const u8)}` to variadic function
22
--> $DIR/issue-32201.rs:9:16
33
|
44
LL | foo(0, bar);
5-
| ^^^ help: cast the value to `fn(*const u8)`: `bar as fn(*const u8)`
5+
| ^^^
6+
|
7+
= help: a function item is zero-sized and needs to be casted into a function pointer to be used in FFI
8+
= note: for more information on function items, visit https://doc.rust-lang.org/reference/types/function-item.html
9+
help: cast the value to `fn(*const u8)`
10+
|
11+
LL | foo(0, bar as fn(*const u8));
12+
| ~~~~~~~~~~~~~~~~~~~~
13+
help: cast the value into a function pointer
14+
|
15+
LL | foo(0, bar as fn(*const u8));
16+
| ++++++++++++++++
617

718
error: aborting due to 1 previous error
819

tests/ui/c-variadic/issue-69232.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ fn test() -> u8 {
88

99
fn main() {
1010
foo(1, test);
11+
//~^ ERROR can't pass `{fn item test: fn() -> u8}` to variadic function
1112
}

tests/ui/c-variadic/issue-69232.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ LL | foo(1, test as fn() -> u8);
1313
help: cast the value into a function pointer
1414
|
1515
LL | foo(1, test as fn() -> u8);
16-
| ~~~~~~~~~~~~~~~~~~
16+
| +++++++++++++
1717

1818
error: aborting due to 1 previous error
1919

tests/ui/c-variadic/variadic-ffi-1.stderr

+60-6
Original file line numberDiff line numberDiff line change
@@ -62,37 +62,91 @@ error[E0617]: can't pass `f32` to variadic function
6262
--> $DIR/variadic-ffi-1.rs:28:19
6363
|
6464
LL | foo(1, 2, 3f32);
65-
| ^^^^ help: cast the value to `c_double`: `3f32 as c_double`
65+
| ^^^^
66+
|
67+
help: cast the value to `c_double`
68+
|
69+
LL | foo(1, 2, 3f32 as c_double);
70+
| ~~~~~~~~~~~~~~~~
71+
help: cast the value to `c_double`
72+
|
73+
LL | foo(1, 2, 3f32 as c_double);
74+
| +++++++++++
6675

6776
error[E0617]: can't pass `bool` to variadic function
6877
--> $DIR/variadic-ffi-1.rs:29:19
6978
|
7079
LL | foo(1, 2, true);
71-
| ^^^^ help: cast the value to `c_int`: `true as c_int`
80+
| ^^^^
81+
|
82+
help: cast the value to `c_int`
83+
|
84+
LL | foo(1, 2, true as c_int);
85+
| ~~~~~~~~~~~~~
86+
help: cast the value to `c_int`
87+
|
88+
LL | foo(1, 2, true as c_int);
89+
| ++++++++
7290

7391
error[E0617]: can't pass `i8` to variadic function
7492
--> $DIR/variadic-ffi-1.rs:30:19
7593
|
7694
LL | foo(1, 2, 1i8);
77-
| ^^^ help: cast the value to `c_int`: `1i8 as c_int`
95+
| ^^^
96+
|
97+
help: cast the value to `c_int`
98+
|
99+
LL | foo(1, 2, 1i8 as c_int);
100+
| ~~~~~~~~~~~~
101+
help: cast the value to `c_int`
102+
|
103+
LL | foo(1, 2, 1i8 as c_int);
104+
| ++++++++
78105

79106
error[E0617]: can't pass `u8` to variadic function
80107
--> $DIR/variadic-ffi-1.rs:31:19
81108
|
82109
LL | foo(1, 2, 1u8);
83-
| ^^^ help: cast the value to `c_uint`: `1u8 as c_uint`
110+
| ^^^
111+
|
112+
help: cast the value to `c_uint`
113+
|
114+
LL | foo(1, 2, 1u8 as c_uint);
115+
| ~~~~~~~~~~~~~
116+
help: cast the value to `c_uint`
117+
|
118+
LL | foo(1, 2, 1u8 as c_uint);
119+
| +++++++++
84120

85121
error[E0617]: can't pass `i16` to variadic function
86122
--> $DIR/variadic-ffi-1.rs:32:19
87123
|
88124
LL | foo(1, 2, 1i16);
89-
| ^^^^ help: cast the value to `c_int`: `1i16 as c_int`
125+
| ^^^^
126+
|
127+
help: cast the value to `c_int`
128+
|
129+
LL | foo(1, 2, 1i16 as c_int);
130+
| ~~~~~~~~~~~~~
131+
help: cast the value to `c_int`
132+
|
133+
LL | foo(1, 2, 1i16 as c_int);
134+
| ++++++++
90135

91136
error[E0617]: can't pass `u16` to variadic function
92137
--> $DIR/variadic-ffi-1.rs:33:19
93138
|
94139
LL | foo(1, 2, 1u16);
95-
| ^^^^ help: cast the value to `c_uint`: `1u16 as c_uint`
140+
| ^^^^
141+
|
142+
help: cast the value to `c_uint`
143+
|
144+
LL | foo(1, 2, 1u16 as c_uint);
145+
| ~~~~~~~~~~~~~~
146+
help: cast the value to `c_uint`
147+
|
148+
LL | foo(1, 2, 1u16 as c_uint);
149+
| +++++++++
96150

97151
error: aborting due to 11 previous errors
98152

tests/ui/cast/cast-as-bool.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ fn main() {
3030
unsafe fn owo() {}
3131

3232
// fn item to bool
33-
let _ = uwu as bool; //~ ERROR cannot cast `fn(u8) -> String {uwu}` as `bool`
33+
let _ = uwu as bool; //~ ERROR cannot cast `{fn item uwu: fn(u8) -> String}` as `bool`
3434
// unsafe fn item
35-
let _ = owo as bool; //~ ERROR cannot cast `unsafe fn() {owo}` as `bool`
35+
let _ = owo as bool; //~ ERROR cannot cast `{fn item owo: unsafe fn()}` as `bool`
3636

3737
// fn ptr to bool
3838
let _ = uwu as fn(u8) -> String as bool; //~ ERROR cannot cast `fn(u8) -> String` as `bool`

tests/ui/cast/cast-as-bool.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ error[E0054]: cannot cast `IntEnum` as `bool`
4848
LL | let _ = IntEnum::One as bool;
4949
| ^^^^^^^^^^^^^^^^^^^^ unsupported cast
5050

51-
error[E0054]: cannot cast `fn(u8) -> String {uwu}` as `bool`
51+
error[E0054]: cannot cast `{fn item uwu: fn(u8) -> String}` as `bool`
5252
--> $DIR/cast-as-bool.rs:33:13
5353
|
5454
LL | let _ = uwu as bool;
5555
| ^^^^^^^^^^^ unsupported cast
5656

57-
error[E0054]: cannot cast `unsafe fn() {owo}` as `bool`
57+
error[E0054]: cannot cast `{fn item owo: unsafe fn()}` as `bool`
5858
--> $DIR/cast-as-bool.rs:35:13
5959
|
6060
LL | let _ = owo as bool;

tests/ui/cast/cast-to-bare-fn.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0605]: non-primitive cast: `fn(isize) {foo}` as `extern "C" fn() -> isize`
1+
error[E0605]: non-primitive cast: `{fn item foo: fn(isize)}` as `extern "C" fn() -> isize`
22
--> $DIR/cast-to-bare-fn.rs:5:13
33
|
44
LL | let x = foo as extern "C" fn() -> isize;

tests/ui/closures/closure_cap_coerce_many_fail.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ error[E0308]: `match` arms have incompatible types
44
LL | let _ = match "+" {
55
| _____________-
66
LL | | "+" => add,
7-
| | --- this is found to be of type `fn(i32, i32) -> i32 {add}`
7+
| | --- this is found to be of type `{fn item add: fn(i32, i32) -> i32}`
88
LL | | "-" => |a, b| (a - b + cap) as i32,
99
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found closure
1010
LL | | _ => unimplemented!(),
1111
LL | | };
1212
| |_____- `match` arms have incompatible types
1313
|
14-
= note: expected fn item `fn(i32, i32) -> i32 {add}`
14+
= note: expected fn item `{fn item add: fn(i32, i32) -> i32}`
1515
found closure `{closure@$DIR/closure_cap_coerce_many_fail.rs:9:16: 9:22}`
1616

1717
error[E0308]: `match` arms have incompatible types

0 commit comments

Comments
 (0)