]>
Commit | Line | Data |
---|---|---|
2b03887a | 1 | error[E0311]: the parameter type `U` may not live long enough |
ed00b5ec | 2 | --> $DIR/async-generics-and-bounds.rs:9:5 |
2b03887a FG |
3 | | |
4 | LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; | |
ed00b5ec FG |
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 | |
2b03887a | 9 | | |
ed00b5ec | 10 | help: consider adding an explicit lifetime bound |
2b03887a | 11 | | |
ed00b5ec FG |
12 | LL | async fn foo<'a>(&'a self) -> &'a (T, U) where T: Debug + Sized, U: Hash, U: 'a; |
13 | | ++++ ++ ++ +++++++ | |
2b03887a FG |
14 | |
15 | error[E0311]: the parameter type `T` may not live long enough | |
ed00b5ec | 16 | --> $DIR/async-generics-and-bounds.rs:9:5 |
2b03887a FG |
17 | | |
18 | LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; | |
ed00b5ec FG |
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 | |
2b03887a | 23 | | |
ed00b5ec | 24 | help: consider adding an explicit lifetime bound |
2b03887a | 25 | | |
ed00b5ec FG |
26 | LL | async fn foo<'a>(&'a self) -> &'a (T, U) where T: Debug + Sized, U: Hash, T: 'a; |
27 | | ++++ ++ ++ +++++++ | |
2b03887a FG |
28 | |
29 | error: aborting due to 2 previous errors | |
30 | ||
31 | For more information about this error, try `rustc --explain E0311`. |