Skip to content

Commit b423eb9

Browse files
committed
Update error messages in UI tests
1 parent c7470de commit b423eb9

File tree

22 files changed

+53
-53
lines changed

22 files changed

+53
-53
lines changed

src/test/ui/asm/x86_64/type-check-2.rs

Lines changed: 1 addition & 1 deletion
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

src/test/ui/associated-types/substs-ppaux.rs

Lines changed: 8 additions & 8 deletions
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

src/test/ui/binop/issue-77910-1.rs

Lines changed: 1 addition & 1 deletion
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<'r> fn(&'r i32) -> &'r i32 {foo}` doesn't implement `Debug`
10+
//~| ERROR `[fn item {foo}: for<'r> fn(&'r i32) -> &'r i32]` doesn't implement `Debug`
1111
}

src/test/ui/c-variadic/issue-32201.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ 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
10+
//~^ ERROR can't pass `[fn item {bar}: fn(*const u8)]` to variadic function
1111
//~| HELP cast the value to `fn(*const u8)`
1212
}
1313
}

src/test/ui/error-codes/E0617.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn main() {
2020
//~^ ERROR can't pass `u16` to variadic function
2121
//~| HELP cast the value to `c_uint`
2222
printf(::std::ptr::null(), printf);
23-
//~^ ERROR can't pass `unsafe extern "C" fn(*const i8, ...) {printf}` to variadic function
23+
//~^ ERROR can't pass `[fn item {printf}: unsafe extern "C" fn(*const i8, ...)]` to variadic function
2424
//~| HELP cast the value to `unsafe extern "C" fn(*const i8, ...)`
2525
}
2626
}

src/test/ui/extern/extern-wrong-value-type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ fn main() {
77
// extern functions are extern "C" fn
88
let _x: extern "C" fn() = f; // OK
99
is_fn(f);
10-
//~^ ERROR expected a `Fn<()>` closure, found `extern "C" fn() {f}`
10+
//~^ ERROR expected a `Fn<()>` closure, found `[fn item {f}: extern "C" fn()]`
1111
}

src/test/ui/fn/fn-item-type.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ impl<T> Foo for T { /* `foo` is still default here */ }
1212
fn main() {
1313
eq(foo::<u8>, bar::<u8>);
1414
//~^ ERROR mismatched types
15-
//~| expected fn item `fn(_) -> _ {foo::<u8>}`
16-
//~| found fn item `fn(_) -> _ {bar::<u8>}`
15+
//~| expected fn item `[fn item {foo::<u8>}: fn(_) -> _]`
16+
//~| found fn item `[fn item {bar::<u8>}: fn(_) -> _]`
1717
//~| expected fn item, found a different fn item
1818
//~| different `fn` items always have unique types, even if their signatures are the same
1919
//~| change the expected type to be function pointer
@@ -28,7 +28,7 @@ fn main() {
2828

2929
eq(bar::<String>, bar::<Vec<u8>>);
3030
//~^ ERROR mismatched types
31-
//~| found fn item `fn(_) -> _ {bar::<Vec<u8>>}`
31+
//~| found fn item `[fn item {bar::<Vec<u8>>}: fn(_) -> _]`
3232
//~| expected struct `String`, found struct `Vec`
3333
//~| different `fn` items always have unique types, even if their signatures are the same
3434
//~| change the expected type to be function pointer

src/test/ui/hygiene/impl_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mod foo {
99
}
1010

1111
pub macro m() {
12-
let _: () = S.f(); //~ ERROR type `for<'r> fn(&'r foo::S) {foo::S::f}` is private
12+
let _: () = S.f(); //~ ERROR type `[fn item {foo::S::f}: for<'r> fn(&'r foo::S)]` is private
1313
}
1414
}
1515

src/test/ui/hygiene/intercrate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ extern crate intercrate;
88

99
fn main() {
1010
assert_eq!(intercrate::foo::m!(), 1);
11-
//~^ ERROR type `fn() -> u32 {foo::bar::f}` is private
11+
//~^ ERROR type `[fn item {foo::bar::f}: fn() -> u32]` is private
1212
}

src/test/ui/issues/issue-59488.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ enum Foo {
1212

1313
fn main() {
1414
foo > 12;
15-
//~^ ERROR binary operation `>` cannot be applied to type `fn() -> i32 {foo}` [E0369]
15+
//~^ ERROR binary operation `>` cannot be applied to type `[fn item {foo}: fn() -> i32]` [E0369]
1616
//~| ERROR mismatched types [E0308]
1717

1818
bar > 13;
19-
//~^ ERROR binary operation `>` cannot be applied to type `fn(i64) -> i64 {bar}` [E0369]
19+
//~^ ERROR binary operation `>` cannot be applied to type `[fn item {bar}: fn(i64) -> i64]` [E0369]
2020
//~| ERROR mismatched types [E0308]
2121

2222
foo > foo;
23-
//~^ ERROR binary operation `>` cannot be applied to type `fn() -> i32 {foo}` [E0369]
23+
//~^ ERROR binary operation `>` cannot be applied to type `[fn item {foo}: fn() -> i32]` [E0369]
2424

2525
foo > bar;
26-
//~^ ERROR binary operation `>` cannot be applied to type `fn() -> i32 {foo}` [E0369]
26+
//~^ ERROR binary operation `>` cannot be applied to type `[fn item {foo}: fn() -> i32]` [E0369]
2727
//~| ERROR mismatched types [E0308]
2828

2929
let i = Foo::Bar;
3030
assert_eq!(Foo::Bar, i);
31-
//~^ ERROR binary operation `==` cannot be applied to type `fn(usize) -> Foo {Foo::Bar}` [E0369]
32-
//~| ERROR `fn(usize) -> Foo {Foo::Bar}` doesn't implement `Debug` [E0277]
31+
//~^ ERROR binary operation `==` cannot be applied to type `[fn item {Foo::Bar}: fn(usize) -> Foo]` [E0369]
32+
//~| ERROR `[fn item {Foo::Bar}: fn(usize) -> Foo]` doesn't implement `Debug` [E0277]
3333
}

0 commit comments

Comments
 (0)