-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Confusing 'type mismatch' error when using function pointer as fn trait #73457
Comments
We can probably improve this error quite dramatically by addressing cases involving closures specifically.
It is a bound, it's the
In E0308 we point at the parameter when possible using some hacky inference that could also be leveraged here. |
What makes this case tricky is that we never actually create a closure - the function pointer is used directly as |
Current output:
|
The following code:
gives this error:
There are several issues with this error:
for<>
binders, the weird{make_it}
syntax for function pointers, and an inference variable).T
a 'bound', even though it's clearly not a bound.make_it
, even though it's part of the issue.This was minimized from code posted by @rvolosatovs.
The text was updated successfully, but these errors were encountered: