rust/src/test/ui/traits/trait-param-without-lifetime-constraint.stderr

22 lines
1.0 KiB
Plaintext
Raw Normal View History

error: `impl` item signature doesn't match `trait` item signature
--> $DIR/trait-param-without-lifetime-constraint.rs:14:5
|
LL | pub trait HaveRelationship<To> {
2020-02-17 01:59:29 +00:00
| -- this type parameter might not have a lifetime compatible with the `impl`
LL | fn get_relation(&self) -> To;
2020-02-17 01:59:29 +00:00
| -----------------------------
| | |
| | you might want to borrow this type parameter in the trait to make it match the `impl`
| expected `fn(&Article) -> &ProofReader`
...
LL | fn get_relation(&self) -> &ProofReader {
2020-02-17 01:59:29 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&Article) -> &ProofReader`
|
= note: expected `fn(&Article) -> &ProofReader`
found `fn(&Article) -> &ProofReader`
2019-12-23 01:53:50 +00:00
= 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
error: aborting due to previous error