-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Standard traits not derived for function pointers with different calling conventions #40710
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
See #38848 (comment) for the reasons. |
I guess the cause for this is similar to reasons that various traits are not defined for very long tuples, arrays over 32 elements, etc. and apparently function pointers with long argument lists. If libcore bloat is an issue, should the compiler instead insert the necessary definitions automatically when needed? Or we need to come up with syntax for "all tuples", etc. |
The tuple case can be handled via variadic generics. The fn pointer case, not so much (unless all of them implement a suitable common trait by magic). |
fn-pointer case could also be handled by variadic generics, for the argument list at least. Then you just need one entry per calling convention which hopefully doesn't result in too much bloat. Array case could of course be handled by integer generics. Are variadic generics something that is seriously considered for Rust's future? If so, we probably still need some kind of stop-gap measure here. If not, we'll need a more definitive solution here. |
Well, there's rust-lang/rfcs#1935 |
Update: the example code now compiles. |
Closing this as the example now compiles |
Errors:
The text was updated successfully, but these errors were encountered: