]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-17758.stderr
Rollup merge of #92942 - Xaeroxe:raw_arg, r=dtolnay
[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 defined here...
8   --> $DIR/issue-17758.rs:6:12
9    |
10 LL |     fn bar(&self) {
11    |            ^^^^^
12 note: ...so that reference does not outlive borrowed content
13   --> $DIR/issue-17758.rs:7:9
14    |
15 LL |         self.foo();
16    |         ^^^^
17 note: but, the lifetime must be valid for the lifetime `'a` as defined here...
18   --> $DIR/issue-17758.rs:4:11
19    |
20 LL | trait Foo<'a> {
21    |           ^^
22 note: ...so that the types are compatible
23   --> $DIR/issue-17758.rs:7:14
24    |
25 LL |         self.foo();
26    |              ^^^
27    = note: expected `&'a Self`
28               found `&Self`
29
30 error: aborting due to previous error
31
32 For more information about this error, try `rustc --explain E0495`.