rust/src/test/ui/issue-17758.stderr
2018-07-15 17:10:52 -07:00

32 lines
965 B
Plaintext

error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
--> $DIR/issue-17758.rs:17:14
|
LL | self.foo();
| ^^^
|
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 16:5...
--> $DIR/issue-17758.rs:16:5
|
LL | / fn bar(&self) {
LL | | self.foo();
LL | | //~^ ERROR cannot infer
LL | | }
| |_____^
note: ...so that reference does not outlive borrowed content
--> $DIR/issue-17758.rs:17:9
|
LL | self.foo();
| ^^^^
note: but, the lifetime must be valid for the lifetime 'a as defined on the trait at 14:11...
--> $DIR/issue-17758.rs:14:11
|
LL | trait Foo<'a> {
| ^^
= note: ...so that the types are compatible:
expected &'a Self
found &Self
error: aborting due to previous error
For more information about this error, try `rustc --explain E0495`.