]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/self_lifetime-async.stderr
e3ec1abd44763863558c96ced88e83cd9599db45
[rust.git] / src / test / ui / self / self_lifetime-async.stderr
1 error[E0106]: missing lifetime specifier
2   --> $DIR/self_lifetime-async.rs:9:44
3    |
4 LL |     async fn foo<'b>(self: &'b Foo<'a>) -> &() { self.0 }
5    |                                            ^
6    |
7    = note: return-position elided lifetimes require exactly one input-position elided lifetime, found none.
8
9 error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
10   --> $DIR/self_lifetime-async.rs:9:22
11    |
12 LL |     async fn foo<'b>(self: &'b Foo<'a>) -> &() { self.0 }
13    |                      ^^^^
14    |
15 note: first, the lifetime cannot outlive the lifetime 'a as defined on the impl at 8:6...
16   --> $DIR/self_lifetime-async.rs:8:6
17    |
18 LL | impl<'a> Foo<'a> {
19    |      ^^
20    = note: ...so that the expression is assignable:
21            expected &Foo<'_>
22               found &'b Foo<'a>
23    = note: but, the lifetime must be valid for the static lifetime...
24    = note: ...so that the types are compatible:
25            expected &()
26               found &'static ()
27
28 error[E0623]: lifetime mismatch
29   --> $DIR/self_lifetime-async.rs:16:52
30    |
31 LL |     async fn bar<'a>(self: &Alias, arg: &'a ()) -> &() { arg }
32    |                            ------                  ^^^
33    |                            |                       |
34    |                            |                       ...but data from `arg` is returned here
35    |                            this parameter and the return type are declared with different lifetimes...
36
37 error: aborting due to 3 previous errors
38
39 For more information about this error, try `rustc --explain E0106`.