@@ -2,35 +2,29 @@ error[E0311]: the parameter type `U` may not live long enough
2
2
--> $DIR/async-generics-and-bounds.rs:12:5
3
3
|
4
4
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
5
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5
+ | ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
+ | | |
7
+ | | the parameter type `U` must be valid for the anonymous lifetime as defined here...
8
+ | ...so that the reference type `&(T, U)` does not outlive the data it points at
6
9
|
7
- note: the parameter type `U` must be valid for the anonymous lifetime as defined here...
8
- --> $DIR/async-generics-and-bounds.rs:12:18
10
+ help: consider adding an explicit lifetime bound
9
11
|
10
- LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
11
- | ^
12
- note: ...so that the reference type `&(T, U)` does not outlive the data it points at
13
- --> $DIR/async-generics-and-bounds.rs:12:5
14
- |
15
- LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
16
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12
+ LL | async fn foo<'a>(&'a self) -> &'a (T, U) where T: Debug + Sized, U: Hash, U: 'a;
13
+ | ++++ ++ ++ +++++++
17
14
18
15
error[E0311]: the parameter type `T` may not live long enough
19
16
--> $DIR/async-generics-and-bounds.rs:12:5
20
17
|
21
18
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
22
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19
+ | ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20
+ | | |
21
+ | | the parameter type `T` must be valid for the anonymous lifetime as defined here...
22
+ | ...so that the reference type `&(T, U)` does not outlive the data it points at
23
23
|
24
- note: the parameter type `T` must be valid for the anonymous lifetime as defined here...
25
- --> $DIR/async-generics-and-bounds.rs:12:18
24
+ help: consider adding an explicit lifetime bound
26
25
|
27
- LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
28
- | ^
29
- note: ...so that the reference type `&(T, U)` does not outlive the data it points at
30
- --> $DIR/async-generics-and-bounds.rs:12:5
31
- |
32
- LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
33
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26
+ LL | async fn foo<'a>(&'a self) -> &'a (T, U) where T: Debug + Sized, U: Hash, T: 'a;
27
+ | ++++ ++ ++ +++++++
34
28
35
29
error: aborting due to 2 previous errors
36
30
0 commit comments