]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-17758.stderr
Rollup merge of #62337 - Mark-Simulacrum:fix-cpu-usage-script, r=alexcrichton
[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:7: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 6:5...
8   --> $DIR/issue-17758.rs:6:5
9    |
10 LL | /     fn bar(&self) {
11 LL | |         self.foo();
12 LL | |
13 LL | |     }
14    | |_____^
15 note: ...so that reference does not outlive borrowed content
16   --> $DIR/issue-17758.rs:7: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 4:11...
21   --> $DIR/issue-17758.rs:4: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