-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Closure seemingly both implements and doesn't implement a trait #79187
Comments
Might be a duplicate of #75791 |
Last night I ran into
which gives the same error message and may be asimpler case of the same thing. |
While perhaps similar to #75791 this one at least isn't a regression, I don't believe this code has ever compiled. |
Is the underlying issue perhaps what's also causing #71723? |
CC #79588 |
Workaround that worked for me for something similar: add type annotations to closure arguments and returns until things start to compile. |
This is a bit of an odd issue that I ran into today, and one that I think is a bug in rustc but I'm not 100% certain. Given this code:
this fails to compile with:
The perplexing part to me is that both calls to
take_foo
seem pretty equivalent, but the second compiles while the first does not. I've managed to get a variety of error messages trying to reduce this, the original project had a much more opaque "the trait bound is not satisfied" error. It may be the case though that the fix for the above snippet is the fix for the original snippet too though.The text was updated successfully, but these errors were encountered: