-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Destructuring fails to infer FnOnce #26139
Comments
Currently the compiler needs a hint when it should move a value into a closure: let consume = move || {
//...
}; Eventually, I think we do want to infer moving upvars but it might be difficult. I think there's already an issue for tracking this problem that explains it in more detail. |
Even with |
So move also is insufficient here - you wind up with the same error. However if you write
it will work, and yet fail ("error: cannot move out of captured outer variable in an |
Closing in favor of #30046 |
This should move
n
but it doesn't. It doesn't seem to infer it properly.Code:
Error:
The text was updated successfully, but these errors were encountered: