Skip to content

Commit 3972a05

Browse files
committed
rustc: print ExistentialProjection with spaces around =, e.g. dyn Foo<A = X>.
1 parent 241ca4f commit 3972a05

12 files changed

+21
-21
lines changed

src/librustc/ty/print/pretty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,7 @@ define_print_and_forward_display! {
14891489

14901490
ty::ExistentialProjection<'tcx> {
14911491
let name = cx.tcx().associated_item(self.item_def_id).ident;
1492-
p!(write("{}=", name), print(self.ty))
1492+
p!(write("{} = ", name), print(self.ty))
14931493
}
14941494

14951495
ty::ExistentialPredicate<'tcx> {

src/test/ui/associated-types/associated-types-eq-3.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ LL | baz(&a);
2929
|
3030
= note: expected type `usize`
3131
found type `Bar`
32-
= note: required for the cast to the object type `dyn Foo<A=Bar>`
32+
= note: required for the cast to the object type `dyn Foo<A = Bar>`
3333

3434
error: aborting due to 3 previous errors
3535

src/test/ui/associated-types/associated-types-overridden-binding-2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | let _: &I32Iterator<Item = u32> = &vec![42].into_iter();
66
|
77
= note: expected type `u32`
88
found type `i32`
9-
= note: required for the cast to the object type `dyn I32Iterator<Item=u32, Item=i32>`
9+
= note: required for the cast to the object type `dyn I32Iterator<Item = u32, Item = i32>`
1010

1111
error: aborting due to previous error
1212

src/test/ui/confuse-field-and-method/issue-2392.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ LL | w.wrap.not_closure();
7575
|
7676
= help: did you mean to write `w.wrap.not_closure` instead of `w.wrap.not_closure(...)`?
7777

78-
error[E0599]: no method named `closure` found for type `Obj<std::boxed::Box<(dyn std::boxed::FnBox<(), Output=u32> + 'static)>>` in the current scope
78+
error[E0599]: no method named `closure` found for type `Obj<std::boxed::Box<(dyn std::boxed::FnBox<(), Output = u32> + 'static)>>` in the current scope
7979
--> $DIR/issue-2392.rs:62:24
8080
|
8181
LL | struct Obj<F> where F: FnOnce() -> u32 {

src/test/ui/issues/issue-20605.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error[E0277]: the size for values of type `dyn std::iter::Iterator<Item=&mut u8>` cannot be known at compilation time
1+
error[E0277]: the size for values of type `dyn std::iter::Iterator<Item = &mut u8>` cannot be known at compilation time
22
--> $DIR/issue-20605.rs:2:17
33
|
44
LL | for item in *things { *item = 0 }
55
| ^^^^^^^ doesn't have a size known at compile-time
66
|
7-
= help: the trait `std::marker::Sized` is not implemented for `dyn std::iter::Iterator<Item=&mut u8>`
7+
= help: the trait `std::marker::Sized` is not implemented for `dyn std::iter::Iterator<Item = &mut u8>`
88
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
99
= note: required by `std::iter::IntoIterator::into_iter`
1010

src/test/ui/issues/issue-22312.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0605]: non-primitive cast: `Self` as `&dyn std::ops::Index<usize, Output=<Self as std::ops::Index<usize>>::Output>`
1+
error[E0605]: non-primitive cast: `Self` as `&dyn std::ops::Index<usize, Output = <Self as std::ops::Index<usize>>::Output>`
22
--> $DIR/issue-22312.rs:11:24
33
|
44
LL | let indexer = &(*self as &Index<usize, Output = <Self as Index<usize>>::Output>);

src/test/ui/issues/issue-55796.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ LL | Box::new(self.out_edges(u).map(|e| e.target()))
1616
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1717
= note: but, the lifetime must be valid for the static lifetime...
1818
= note: ...so that the expression is assignable:
19-
expected std::boxed::Box<(dyn std::iter::Iterator<Item=<Self as Graph<'a>>::Node> + 'static)>
20-
found std::boxed::Box<dyn std::iter::Iterator<Item=<Self as Graph<'a>>::Node>>
19+
expected std::boxed::Box<(dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node> + 'static)>
20+
found std::boxed::Box<dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node>>
2121

2222
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
2323
--> $DIR/issue-55796.rs:21:9
@@ -37,8 +37,8 @@ LL | Box::new(self.in_edges(u).map(|e| e.target()))
3737
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3838
= note: but, the lifetime must be valid for the static lifetime...
3939
= note: ...so that the expression is assignable:
40-
expected std::boxed::Box<(dyn std::iter::Iterator<Item=<Self as Graph<'a>>::Node> + 'static)>
41-
found std::boxed::Box<dyn std::iter::Iterator<Item=<Self as Graph<'a>>::Node>>
40+
expected std::boxed::Box<(dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node> + 'static)>
41+
found std::boxed::Box<dyn std::iter::Iterator<Item = <Self as Graph<'a>>::Node>>
4242

4343
error: aborting due to 2 previous errors
4444

src/test/ui/retslot-cast.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ error[E0308]: mismatched types
22
--> $DIR/retslot-cast.rs:13:5
33
|
44
LL | inner(x)
5-
| ^^^^^^^^ expected trait `std::iter::Iterator<Item=()>`, found trait `std::iter::Iterator<Item=()> + std::marker::Send`
5+
| ^^^^^^^^ expected trait `std::iter::Iterator<Item = ()>`, found trait `std::iter::Iterator<Item = ()> + std::marker::Send`
66
|
7-
= note: expected type `std::option::Option<&dyn std::iter::Iterator<Item=()>>`
8-
found type `std::option::Option<&dyn std::iter::Iterator<Item=()> + std::marker::Send>`
7+
= note: expected type `std::option::Option<&dyn std::iter::Iterator<Item = ()>>`
8+
found type `std::option::Option<&dyn std::iter::Iterator<Item = ()> + std::marker::Send>`
99

1010
error: aborting due to previous error
1111

src/test/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | *x
77
| ^^ expected (), found trait std::iter::Iterator
88
|
99
= note: expected type `()`
10-
found type `(dyn std::iter::Iterator<Item=()> + 'static)`
10+
found type `(dyn std::iter::Iterator<Item = ()> + 'static)`
1111

1212
error: aborting due to previous error
1313

src/test/ui/unboxed-closures/unboxed-closure-sugar-default.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0277]: the trait bound `dyn Foo<(isize,), isize, Output=()>: Eq<dyn Foo<(isize,), Output=()>>` is not satisfied
1+
error[E0277]: the trait bound `dyn Foo<(isize,), isize, Output = ()>: Eq<dyn Foo<(isize,), Output = ()>>` is not satisfied
22
--> $DIR/unboxed-closure-sugar-default.rs:21:5
33
|
44
LL | eq::< Foo<(isize,),isize,Output=()>, Foo(isize) >();
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Eq<dyn Foo<(isize,), Output=()>>` is not implemented for `dyn Foo<(isize,), isize, Output=()>`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Eq<dyn Foo<(isize,), Output = ()>>` is not implemented for `dyn Foo<(isize,), isize, Output = ()>`
66
|
77
note: required by `eq`
88
--> $DIR/unboxed-closure-sugar-default.rs:14:1

src/test/ui/unboxed-closures/unboxed-closure-sugar-equiv.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
error[E0277]: the trait bound `dyn Foo<(char,), Output=()>: Eq<dyn Foo<(), Output=()>>` is not satisfied
1+
error[E0277]: the trait bound `dyn Foo<(char,), Output = ()>: Eq<dyn Foo<(), Output = ()>>` is not satisfied
22
--> $DIR/unboxed-closure-sugar-equiv.rs:43:5
33
|
44
LL | / eq::< Foo<(),Output=()>,
55
LL | | Foo(char) >();
6-
| |___________________________________________________________________^ the trait `Eq<dyn Foo<(), Output=()>>` is not implemented for `dyn Foo<(char,), Output=()>`
6+
| |___________________________________________________________________^ the trait `Eq<dyn Foo<(), Output = ()>>` is not implemented for `dyn Foo<(char,), Output = ()>`
77
|
88
note: required by `eq`
99
--> $DIR/unboxed-closure-sugar-equiv.rs:16:1

src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ LL | Box::new(items.iter())
1919
| ^^^^^
2020
= note: but, the lifetime must be valid for the static lifetime...
2121
= note: ...so that the expression is assignable:
22-
expected std::boxed::Box<(dyn std::iter::Iterator<Item=&T> + 'static)>
23-
found std::boxed::Box<dyn std::iter::Iterator<Item=&T>>
22+
expected std::boxed::Box<(dyn std::iter::Iterator<Item = &T> + 'static)>
23+
found std::boxed::Box<dyn std::iter::Iterator<Item = &T>>
2424

2525
error: aborting due to previous error
2626

0 commit comments

Comments
 (0)