2018-07-15 16:11:54 -05:00
|
|
|
error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/issue-17758.rs:7:14
|
2018-07-15 16:11:54 -05:00
|
|
|
|
|
|
|
|
LL | self.foo();
|
|
|
|
| ^^^
|
|
|
|
|
|
2018-12-25 09:56:47 -06:00
|
|
|
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 6:5...
|
|
|
|
--> $DIR/issue-17758.rs:6:5
|
2018-07-15 16:11:54 -05:00
|
|
|
|
|
|
|
|
LL | / fn bar(&self) {
|
|
|
|
LL | | self.foo();
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | |
|
2018-07-15 16:11:54 -05:00
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
note: ...so that reference does not outlive borrowed content
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/issue-17758.rs:7:9
|
2018-07-15 16:11:54 -05:00
|
|
|
|
|
|
|
|
LL | self.foo();
|
|
|
|
| ^^^^
|
2018-12-25 09:56:47 -06:00
|
|
|
note: but, the lifetime must be valid for the lifetime 'a as defined on the trait at 4:11...
|
|
|
|
--> $DIR/issue-17758.rs:4:11
|
2018-07-15 16:11:54 -05:00
|
|
|
|
|
|
|
|
LL | trait Foo<'a> {
|
|
|
|
| ^^
|
|
|
|
= note: ...so that the types are compatible:
|
|
|
|
expected &'a Self
|
|
|
|
found &Self
|
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|