1
Fork 0

improve the suggestion of generic_bound_failure

This commit is contained in:
Ali MJ Al-Nasrawy 2023-09-08 01:35:51 +00:00
parent 6d271692b0
commit 5be0b2283a
28 changed files with 696 additions and 384 deletions

View file

@ -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