about summary refs log tree commit diff
path: root/src/test/ui/issues/issue-17758.stderr
blob: f82e0f53a23df2f7b600a5b665082ce6c14c2d35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
  --> $DIR/issue-17758.rs:7:14
   |
LL |         self.foo();
   |              ^^^
   |
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 6:5...
  --> $DIR/issue-17758.rs:6:5
   |
LL |     fn bar(&self) {
   |     ^^^^^^^^^^^^^
note: ...so that reference does not outlive borrowed content
  --> $DIR/issue-17758.rs:7:9
   |
LL |         self.foo();
   |         ^^^^
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
   |
LL | trait Foo<'a> {
   |           ^^
note: ...so that the types are compatible
  --> $DIR/issue-17758.rs:7:14
   |
LL |         self.foo();
   |              ^^^
   = note: expected `&'a Self`
              found `&Self`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0495`.