Review comments: split requirement text to multiple lines for readability

This commit is contained in:
Esteban Küber 2020-02-21 13:39:47 -08:00
parent 01286408c1
commit 7c29441ef2
11 changed files with 33 additions and 17 deletions

View file

@ -639,7 +639,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
None => format!("`{}`", p),
Some((parent_p, _)) => {
collect_type_param_suggestions(self_ty, parent_pred, &p);
format!("`{}` which is required by `{}`", p, parent_p)
format!("`{}`\nwhich is required by `{}`", p, parent_p)
}
},
})

View file

@ -14,7 +14,8 @@ LL | Bar::<NotClone> { x: 1 }.clone();
| ^^^^^ method not found in `Bar<NotClone>`
|
= note: the method `clone` exists but the following trait bounds were not satisfied:
`NotClone: std::clone::Clone` which is required by `Bar<NotClone>: std::clone::Clone`
`NotClone: std::clone::Clone`
which is required by `Bar<NotClone>: std::clone::Clone`
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `clone`, perhaps you need to implement it:
candidate #1: `std::clone::Clone`

View file

@ -7,7 +7,8 @@ LL | println!("{}", z.to_string());
= note: try using `<*const T>::as_ref()` to get a reference to the type behind the pointer: https://doc.rust-lang.org/std/primitive.pointer.html#method.as_ref
= note: using `<*const T>::as_ref()` on a pointer which is unaligned or points to invalid or uninitialized memory is undefined behavior
= note: the method `to_string` exists but the following trait bounds were not satisfied:
`*const u8: std::fmt::Display` which is required by `*const u8: std::string::ToString`
`*const u8: std::fmt::Display`
which is required by `*const u8: std::string::ToString`
error: aborting due to previous error

View file

@ -22,8 +22,10 @@ LL | pub struct TakeWhile<I, P> {
| -------------------------- doesn't satisfy `<_ as std::iter::Iterator>::Item = &_`
|
= note: the method `collect` exists but the following trait bounds were not satisfied:
`<std::iter::TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:10:39: 13:6 found_e:_]> as std::iter::Iterator>::Item = &_` which is required by `std::iter::Cloned<std::iter::TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:10:39: 13:6 found_e:_]>>: std::iter::Iterator`
`std::iter::Cloned<std::iter::TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:10:39: 13:6 found_e:_]>>: std::iter::Iterator` which is required by `&mut std::iter::Cloned<std::iter::TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:10:39: 13:6 found_e:_]>>: std::iter::Iterator`
`<std::iter::TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:10:39: 13:6 found_e:_]> as std::iter::Iterator>::Item = &_`
which is required by `std::iter::Cloned<std::iter::TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:10:39: 13:6 found_e:_]>>: std::iter::Iterator`
`std::iter::Cloned<std::iter::TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:10:39: 13:6 found_e:_]>>: std::iter::Iterator`
which is required by `&mut std::iter::Cloned<std::iter::TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:10:39: 13:6 found_e:_]>>: std::iter::Iterator`
error: aborting due to 2 previous errors

View file

@ -44,7 +44,8 @@ LL | .take()
| ^^^^ method not found in `Foo`
|
= note: the method `take` exists but the following trait bounds were not satisfied:
`Foo: std::iter::Iterator` which is required by `&mut Foo: std::iter::Iterator`
`Foo: std::iter::Iterator`
which is required by `&mut Foo: std::iter::Iterator`
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following traits define an item `take`, perhaps you need to implement one of them:
candidate #1: `std::io::Read`

View file

@ -13,9 +13,12 @@ LL | pub struct Filter<I, P> {
| ----------------------- doesn't satisfy `_: std::iter::Iterator`
|
= note: the method `count` exists but the following trait bounds were not satisfied:
`<[closure@$DIR/issue-36053-2.rs:11:39: 11:53] as std::ops::FnOnce<(&&str,)>>::Output = bool` which is required by `std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:11:39: 11:53]>: std::iter::Iterator`
`[closure@$DIR/issue-36053-2.rs:11:39: 11:53]: std::ops::FnMut<(&&str,)>` which is required by `std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:11:39: 11:53]>: std::iter::Iterator`
`std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:11:39: 11:53]>: std::iter::Iterator` which is required by `&mut std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:11:39: 11:53]>: std::iter::Iterator`
`<[closure@$DIR/issue-36053-2.rs:11:39: 11:53] as std::ops::FnOnce<(&&str,)>>::Output = bool`
which is required by `std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:11:39: 11:53]>: std::iter::Iterator`
`[closure@$DIR/issue-36053-2.rs:11:39: 11:53]: std::ops::FnMut<(&&str,)>`
which is required by `std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:11:39: 11:53]>: std::iter::Iterator`
`std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:11:39: 11:53]>: std::iter::Iterator`
which is required by `&mut std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:11:39: 11:53]>: std::iter::Iterator`
error[E0631]: type mismatch in closure arguments
--> $DIR/issue-36053-2.rs:11:32

View file

@ -11,8 +11,10 @@ LL | self.foo();
| ^^^ method not found in `&Foo<T>`
|
= note: the method `foo` exists but the following trait bounds were not satisfied:
`T: Bar` which is required by `Foo<T>: Bar`
`T: std::default::Default` which is required by `Foo<T>: Bar`
`T: Bar`
which is required by `Foo<T>: Bar`
`T: std::default::Default`
which is required by `Foo<T>: Bar`
= help: items from traits can only be used if the trait is implemented and in scope
help: consider restricting the type parameters to satisfy the obligations
|
@ -32,7 +34,8 @@ LL | self.foo();
| ^^^ method not found in `&Fin<T>`
|
= note: the method `foo` exists but the following trait bounds were not satisfied:
`T: std::default::Default` which is required by `Fin<T>: Bar`
`T: std::default::Default`
which is required by `Fin<T>: Bar`
= help: items from traits can only be used if the trait is implemented and in scope
help: consider restricting the type parameter to satisfy the obligation
|

View file

@ -37,7 +37,8 @@ LL | pub struct BufWriter<W: Write> {
| ------------------------------ doesn't satisfy `_: std::io::Write`
|
= note: the method `write_fmt` exists but the following trait bounds were not satisfied:
`&dyn std::io::Write: std::io::Write` which is required by `std::io::BufWriter<&dyn std::io::Write>: std::io::Write`
`&dyn std::io::Write: std::io::Write`
which is required by `std::io::BufWriter<&dyn std::io::Write>: std::io::Write`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 4 previous errors

View file

@ -23,7 +23,8 @@ LL | let w = u.clone();
| ^^^^^ method not found in `U5<CloneNoCopy>`
|
= note: the method `clone` exists but the following trait bounds were not satisfied:
`CloneNoCopy: std::marker::Copy` which is required by `U5<CloneNoCopy>: std::clone::Clone`
`CloneNoCopy: std::marker::Copy`
which is required by `U5<CloneNoCopy>: std::clone::Clone`
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `clone`, perhaps you need to implement it:
candidate #1: `std::clone::Clone`

View file

@ -16,8 +16,10 @@ LL | pub struct Box<T: ?Sized>(Unique<T>);
| ------------------------------------- doesn't satisfy `std::boxed::Box<dyn Foo>: std::clone::Clone`
|
= note: the method `clone` exists but the following trait bounds were not satisfied:
`dyn Foo: std::clone::Clone` which is required by `std::boxed::Box<dyn Foo>: std::clone::Clone`
`dyn Foo: std::marker::Sized` which is required by `std::boxed::Box<dyn Foo>: std::clone::Clone`
`dyn Foo: std::clone::Clone`
which is required by `std::boxed::Box<dyn Foo>: std::clone::Clone`
`dyn Foo: std::marker::Sized`
which is required by `std::boxed::Box<dyn Foo>: std::clone::Clone`
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `clone`, perhaps you need to implement it:
candidate #1: `std::clone::Clone`

View file

@ -13,7 +13,8 @@ LL | pub struct Box<T: ?Sized>(Unique<T>);
| ------------------------------------- doesn't satisfy `std::boxed::Box<R>: std::clone::Clone`
|
= note: the method `clone` exists but the following trait bounds were not satisfied:
`R: std::clone::Clone` which is required by `std::boxed::Box<R>: std::clone::Clone`
`R: std::clone::Clone`
which is required by `std::boxed::Box<R>: std::clone::Clone`
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `clone`, perhaps you need to implement it:
candidate #1: `std::clone::Clone`