-
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
Allow to dispatch fn traits depending on number of parameters #55986
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cramertj (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Can you add the comment and explain that one case?
ab168ba
to
2ab7a74
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we tweak the tests a bit to show that we are actually calling the fn as expected etc?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ee1c962
to
4522900
Compare
This comment has been minimized.
This comment has been minimized.
Those tests are directly taken from the comments on the bug reports.
When resolving Fn traits, the compiler failed to take into account overloaded implementations. To resolve this, we inform the trait dispatch code that the arguments will becoming as a tuple of correct arity.
This allows to verify that we handle different types as return types, and that we call the expected functions.
4522900
to
91c155b
Compare
@bors r+ |
📌 Commit 91c155b has been approved by |
⌛ Testing commit 91c155b with merge cbacd348a2f5b0ec3efc8813245b6efb6f497883... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Allow to dispatch fn traits depending on number of parameters Hello, By following @eddyb's advise on issue rust-lang#45510, I managed to have the snippets of code in rust-lang#45510 and rust-lang#18952 passing without breaking older diagnostics. EDIT: the codegen tests breakage I experienced is due to the poor quality of my laptop. If any kind reviewer has any advice, you are very welcome.
Allow to dispatch fn traits depending on number of parameters Hello, By following @eddyb's advise on issue #45510, I managed to have the snippets of code in #45510 and #18952 passing without breaking older diagnostics. EDIT: the codegen tests breakage I experienced is due to the poor quality of my laptop. If any kind reviewer has any advice, you are very welcome.
☀️ Test successful - status-appveyor, status-travis |
Hello,
By following @eddyb's advise on issue #45510, I managed to have the snippets of code in #45510 and #18952 passing without breaking older diagnostics.
EDIT: the codegen tests breakage I experienced is due to the poor quality of my laptop.
If any kind reviewer has any advice, you are very welcome.