review comments: change wording and visual output

This commit is contained in:
Esteban Küber 2020-05-27 20:58:05 -07:00
parent cb6408afc6
commit f213acf4db
6 changed files with 26 additions and 59 deletions

View file

@ -11,7 +11,7 @@ LL | fn deref(&self) -> &Self::Target;
|
= note: expected `fn(&Struct) -> &(dyn Trait + 'static)`
found `fn(&Struct) -> &dyn Trait`
= note: the lifetime requirements from the `trait` could not be satisfied by the `impl`
= help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait`
= help: verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output
error: aborting due to previous error

View file

@ -9,7 +9,7 @@ LL | fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 {
|
= note: expected `fn(&i32, &'a u32, &u32) -> &'a u32`
found `fn(&i32, &u32, &u32) -> &u32`
= note: the lifetime requirements from the `trait` could not be satisfied by the `impl`
= help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait`
= help: verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output
error: aborting due to previous error

View file

@ -9,7 +9,7 @@ LL | fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 {
|
= note: expected `fn(&i32, &'a u32, &u32) -> &'a u32`
found `fn(&i32, &u32, &u32) -> &u32`
= note: the lifetime requirements from the `trait` could not be satisfied by the `impl`
= help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait`
= help: verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output
error[E0623]: lifetime mismatch

View file

@ -9,7 +9,7 @@ LL | fn foo<'a>(x: &'a i32, y: &'a i32) -> &'a i32 {
|
= note: expected `fn(&i32, &'a i32) -> &'a i32`
found `fn(&i32, &i32) -> &i32`
= note: the lifetime requirements from the `trait` could not be satisfied by the `impl`
= help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait`
= help: verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output
error: aborting due to previous error

View file

@ -1,21 +1,19 @@
error: `impl` item signature doesn't match `trait` item signature
--> $DIR/trait-param-without-lifetime-constraint.rs:14:5
|
LL | pub trait HaveRelationship<To> {
| -- this type parameter might not have a lifetime compatible with the `impl`
LL | fn get_relation(&self) -> To;
| -----------------------------
| | |
| | you might want to borrow this type parameter in the trait to make it match the `impl`
| expected `fn(&Article) -> &ProofReader`
| ----------------------------- expected `fn(&Article) -> &ProofReader`
...
LL | fn get_relation(&self) -> &ProofReader {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&Article) -> &ProofReader`
|
= note: expected `fn(&Article) -> &ProofReader`
found `fn(&Article) -> &ProofReader`
= note: the lifetime requirements from the `trait` could not be satisfied by the `impl`
= help: verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output
help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait`
--> $DIR/trait-param-without-lifetime-constraint.rs:10:31
|
LL | fn get_relation(&self) -> To;
| ^^ consider borrowing this type parameter in the trait
error: aborting due to previous error