]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/in-trait/async-associated-types.stderr
Add tracking issue number.
[rust.git] / src / test / ui / async-await / in-trait / async-associated-types.stderr
1 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
2   --> $DIR/async-associated-types.rs:19:43
3    |
4 LL |     async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
5    |                                           ^^^^^^^^^^^^^^
6    |
7 note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
8   --> $DIR/async-associated-types.rs:16:6
9    |
10 LL | impl<'a, 'b, T: Debug + Sized + 'b, U: 'a> MyTrait<'a, 'b, T> for U {
11    |      ^^
12 note: ...so that the types are compatible
13   --> $DIR/async-associated-types.rs:19:43
14    |
15 LL |     async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
16    |                                           ^^^^^^^^^^^^^^
17    = note: expected `(&'a U, &'b T)`
18               found `(&U, &T)`
19    = note: but, the lifetime must be valid for the static lifetime...
20 note: ...so that the types are compatible
21   --> $DIR/async-associated-types.rs:19:43
22    |
23 LL |     async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
24    |                                           ^^^^^^^^^^^^^^
25    = note: expected `MyTrait<'static, 'static, T>`
26               found `MyTrait<'_, '_, T>`
27
28 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements
29   --> $DIR/async-associated-types.rs:19:43
30    |
31 LL |     async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
32    |                                           ^^^^^^^^^^^^^^
33    |
34 note: first, the lifetime cannot outlive the lifetime `'b` as defined here...
35   --> $DIR/async-associated-types.rs:16:10
36    |
37 LL | impl<'a, 'b, T: Debug + Sized + 'b, U: 'a> MyTrait<'a, 'b, T> for U {
38    |          ^^
39 note: ...so that the types are compatible
40   --> $DIR/async-associated-types.rs:19:43
41    |
42 LL |     async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
43    |                                           ^^^^^^^^^^^^^^
44    = note: expected `(&'a U, &'b T)`
45               found `(&U, &T)`
46    = note: but, the lifetime must be valid for the static lifetime...
47 note: ...so that the types are compatible
48   --> $DIR/async-associated-types.rs:19:43
49    |
50 LL |     async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
51    |                                           ^^^^^^^^^^^^^^
52    = note: expected `MyTrait<'static, 'static, T>`
53               found `MyTrait<'_, '_, T>`
54
55 error: aborting due to 2 previous errors
56
57 For more information about this error, try `rustc --explain E0495`.