improve the suggestion of generic_bound_failure
This commit is contained in:
parent
6d271692b0
commit
5be0b2283a
28 changed files with 696 additions and 384 deletions
|
@ -14,6 +14,10 @@ note: ...so that the reference type `&(T, U)` does not outlive the data it point
|
|||
|
|
||||
LL | async fn foo(&self) -> &(T, U);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: consider adding an explicit lifetime bound...
|
||||
|
|
||||
LL | async fn foo<'a>(&'a self) -> &'a (T, U) where U: 'a;
|
||||
| ++++ ++ ++ +++++++++++
|
||||
|
||||
error[E0311]: the parameter type `T` may not live long enough
|
||||
--> $DIR/async-generics.rs:9:5
|
||||
|
@ -31,6 +35,10 @@ note: ...so that the reference type `&(T, U)` does not outlive the data it point
|
|||
|
|
||||
LL | async fn foo(&self) -> &(T, U);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: consider adding an explicit lifetime bound...
|
||||
|
|
||||
LL | async fn foo<'a>(&'a self) -> &'a (T, U) where T: 'a;
|
||||
| ++++ ++ ++ +++++++++++
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue