rustc: print ExistentialProjection with spaces around =, e.g. dyn Foo<A = X>.

This commit is contained in:
Eduard-Mihai Burtescu 2019-02-04 00:48:16 +02:00
parent a54a41ce47
commit 22d6c55cdf
12 changed files with 21 additions and 21 deletions

View file

@ -1489,7 +1489,7 @@ define_print_and_forward_display! {
ty::ExistentialProjection<'tcx> {
let name = cx.tcx().associated_item(self.item_def_id).ident;
p!(write("{}=", name), print(self.ty))
p!(write("{} = ", name), print(self.ty))
}
ty::ExistentialPredicate<'tcx> {

View file

@ -29,7 +29,7 @@ LL | baz(&a);
|
= note: expected type `usize`
found type `Bar`
= note: required for the cast to the object type `dyn Foo<A=Bar>`
= note: required for the cast to the object type `dyn Foo<A = Bar>`
error: aborting due to 3 previous errors

View file

@ -6,7 +6,7 @@ LL | let _: &I32Iterator<Item = u32> = &vec![42].into_iter();
|
= note: expected type `u32`
found type `i32`
= note: required for the cast to the object type `dyn I32Iterator<Item=u32, Item=i32>`
= note: required for the cast to the object type `dyn I32Iterator<Item = u32, Item = i32>`
error: aborting due to previous error

View file

@ -75,7 +75,7 @@ LL | w.wrap.not_closure();
|
= help: did you mean to write `w.wrap.not_closure` instead of `w.wrap.not_closure(...)`?
error[E0599]: no method named `closure` found for type `Obj<std::boxed::Box<(dyn std::boxed::FnBox<(), Output=u32> + 'static)>>` in the current scope
error[E0599]: no method named `closure` found for type `Obj<std::boxed::Box<(dyn std::boxed::FnBox<(), Output = u32> + 'static)>>` in the current scope
--> $DIR/issue-2392.rs:62:24
|
LL | struct Obj<F> where F: FnOnce() -> u32 {

View file

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

View file

@ -1,4 +1,4 @@
error[E0605]: non-primitive cast: `Self` as `&dyn std::ops::Index<usize, Output=<Self as std::ops::Index<usize>>::Output>`
error[E0605]: non-primitive cast: `Self` as `&dyn std::ops::Index<usize, Output = <Self as std::ops::Index<usize>>::Output>`
--> $DIR/issue-22312.rs:11:24
|
LL | let indexer = &(*self as &Index<usize, Output = <Self as Index<usize>>::Output>);

View file

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

View file

@ -2,10 +2,10 @@ error[E0308]: mismatched types
--> $DIR/retslot-cast.rs:13:5
|
LL | inner(x)
| ^^^^^^^^ expected trait `std::iter::Iterator<Item=()>`, found trait `std::iter::Iterator<Item=()> + std::marker::Send`
| ^^^^^^^^ expected trait `std::iter::Iterator<Item = ()>`, found trait `std::iter::Iterator<Item = ()> + std::marker::Send`
|
= note: expected type `std::option::Option<&dyn std::iter::Iterator<Item=()>>`
found type `std::option::Option<&dyn std::iter::Iterator<Item=()> + std::marker::Send>`
= note: expected type `std::option::Option<&dyn std::iter::Iterator<Item = ()>>`
found type `std::option::Option<&dyn std::iter::Iterator<Item = ()> + std::marker::Send>`
error: aborting due to previous error

View file

@ -7,7 +7,7 @@ LL | *x
| ^^ expected (), found trait std::iter::Iterator
|
= note: expected type `()`
found type `(dyn std::iter::Iterator<Item=()> + 'static)`
found type `(dyn std::iter::Iterator<Item = ()> + 'static)`
error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error[E0277]: the trait bound `dyn Foo<(isize,), isize, Output=()>: Eq<dyn Foo<(isize,), Output=()>>` is not satisfied
error[E0277]: the trait bound `dyn Foo<(isize,), isize, Output = ()>: Eq<dyn Foo<(isize,), Output = ()>>` is not satisfied
--> $DIR/unboxed-closure-sugar-default.rs:21:5
|
LL | eq::< Foo<(isize,),isize,Output=()>, Foo(isize) >();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Eq<dyn Foo<(isize,), Output=()>>` is not implemented for `dyn Foo<(isize,), isize, Output=()>`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Eq<dyn Foo<(isize,), Output = ()>>` is not implemented for `dyn Foo<(isize,), isize, Output = ()>`
|
note: required by `eq`
--> $DIR/unboxed-closure-sugar-default.rs:14:1

View file

@ -1,9 +1,9 @@
error[E0277]: the trait bound `dyn Foo<(char,), Output=()>: Eq<dyn Foo<(), Output=()>>` is not satisfied
error[E0277]: the trait bound `dyn Foo<(char,), Output = ()>: Eq<dyn Foo<(), Output = ()>>` is not satisfied
--> $DIR/unboxed-closure-sugar-equiv.rs:43:5
|
LL | / eq::< Foo<(),Output=()>,
LL | | Foo(char) >();
| |___________________________________________________________________^ the trait `Eq<dyn Foo<(), Output=()>>` is not implemented for `dyn Foo<(char,), Output=()>`
| |___________________________________________________________________^ the trait `Eq<dyn Foo<(), Output = ()>>` is not implemented for `dyn Foo<(char,), Output = ()>`
|
note: required by `eq`
--> $DIR/unboxed-closure-sugar-equiv.rs:16:1

View file

@ -19,8 +19,8 @@ LL | Box::new(items.iter())
| ^^^^^
= note: but, the lifetime must be valid for the static lifetime...
= note: ...so that the expression is assignable:
expected std::boxed::Box<(dyn std::iter::Iterator<Item=&T> + 'static)>
found std::boxed::Box<dyn std::iter::Iterator<Item=&T>>
expected std::boxed::Box<(dyn std::iter::Iterator<Item = &T> + 'static)>
found std::boxed::Box<dyn std::iter::Iterator<Item = &T>>
error: aborting due to previous error