-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closure capture calculated incorrectly for non-binding match #14754
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
Comments
This is really strange: if I print the size of closures, it shows 0 for both of them (playground) |
Ah, I guess the coercion logic sees the captures "by syntax" rather by semantics? Nevertheless there is an error on our side since the second one captures for us when it shouldn't then (though i suppose that comes from our match checking logic which is slightly flawed in general I think?) |
Makes sense.
No IIRC I didn't implement the match part of the capturing logic at all :) |
Add `moved-out-of-ref` diagnostic This is marked as experimental, since spans are terrible, there are some false positives due #14754, and it doesn't play well with unknown types. But I hope we can soon lift it.
Handle match scrutinee in closure captures fix #14754
The following closures capture x by value both
playground
yet we recognize the first as non capturing and the second as capturing by ref.
The text was updated successfully, but these errors were encountered: