-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lifetime is unnecessarily captured in nested functions returning impl trait via async #63032
Comments
Check-in from async-await foundations wg: marking as blocking for now and self-assigning to do a bit of investigation. Not entirely sure what's going on. |
OK, so, first of all -- removing the |
I think that this bug is a duplicate of #42940. What happens is that the return type of |
As this is a duplicate of #42940, it doesn't need to block stabilization. In particular, I believe that improving our ability to figure out that the type is |
Triage: to get this to compile on stable, you only need to remove the feature flag, the code still "works." It fails to compile, and removing |
Closing this as this now compiles |
When trying to create some futures that do a bit of work up-front to avoid borrowing some inputs, I ran into this strange issue where it seems like an input lifetime is being unnecessarily captured by the returned impl trait even though the value isn't:
It also seems really weird that this only happens with 2 layers of "nesting" -
start
compiles just fine, butquery
doesn't even though it's pretty much just a pass-through.The text was updated successfully, but these errors were encountered: