]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-17758.stderr
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / ui / issues / issue-17758.stderr
1 error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
2   --> $DIR/issue-17758.rs:17:14
3    |
4 LL |         self.foo();
5    |              ^^^
6    |
7 note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 16:5...
8   --> $DIR/issue-17758.rs:16:5
9    |
10 LL | /     fn bar(&self) {
11 LL | |         self.foo();
12 LL | |         //~^ ERROR cannot infer
13 LL | |     }
14    | |_____^
15 note: ...so that reference does not outlive borrowed content
16   --> $DIR/issue-17758.rs:17:9
17    |
18 LL |         self.foo();
19    |         ^^^^
20 note: but, the lifetime must be valid for the lifetime 'a as defined on the trait at 14:11...
21   --> $DIR/issue-17758.rs:14:11
22    |
23 LL | trait Foo<'a> {
24    |           ^^
25    = note: ...so that the types are compatible:
26            expected &'a Self
27               found &Self
28
29 error: aborting due to previous error
30
31 For more information about this error, try `rustc --explain E0495`.