-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add blanket impls to allow the various Fn
traits to be interconverted.
#18388
Conversation
58c558f
to
a6e38e4
Compare
impl<F,A,R> FnMut<A,R> for F | ||
where F : Fn<A,R> | ||
{ | ||
#[rust_call_abi_hack] |
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.
Is this still needed? I thought it was only needed until a snapshot landed and could be replaced with extern "rust-call"
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.
@luqmana I think you are correct.
Hmm, I still think this approach is right, but it does yield many more inference failures, due to a similar situation as described in #17901. It is likely that using an associated type for the fn return would help here, but I'd prefer not to couple these two features. I'll ponder for a bit if there's a way to improve the situation. |
a6e38e4
to
d436f03
Compare
OK, this version of the branch passes tests. It also fixes #17901 along the way, although I think there may be a more comprehensive fix (this version does cause the example there to compile successfully, however). |
r? @aturon for these latest changes, since he and I discussed them at a high-level. |
d436f03
to
ab4cf32
Compare
d12c26d
to
d22fefb
Compare
…type variables in the intracrate case. This requires a deeper distinction between inter- and intra-crate so as to keep coherence working. I suspect the best fix is to generalize the recursion check that exists today, but this requires a bit more refactoring to achieve. (In other words, where today it says OK for an exact match, we'd want to not detect exact matches but rather skolemize each trait-reference fresh and return AMBIG -- but that requires us to make builtin bounds work shallowly like everything else and move the cycle detection into the fulfillment context.)
d22fefb
to
cf753a2
Compare
Add blanket impls to allow the various `Fn` traits to be interconverted. Fixes #18387.
Fix checking for `false` `labelDetailsSupport` value.
Add blanket impls to allow the various
Fn
traits to be interconverted.Fixes #18387.