-
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 Fn impl to Arc #89771
Add Fn impl to Arc #89771
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. Please see the contribution instructions for more information. |
I think this would be a valuable addition to rust, however it has been tried and rejected in the past: #71570 But maybe the situation changed since? |
Just checking if the test in #71570 works for my changes. Feel free to close this PR due to historical/breaking changes. |
The previous PR was closed because the presented motivation did not feel strong enough to override the desire to avoid breaking changes, particularly ones judged major by accepted policy. Do you have a motivating example for this? If this is just motivated by a desire to clean up and inconsistency, then I think we can just close this PR, that is insufficient IMO to motivate overriding the breaking change concern. |
My personal use case is that i'd like to have a trait with an associated types that must implement This is a contrived example of what I would to be able to do:
|
Was there discussion about adding the corresponding impls for |
Ping from triage: |
I think these missing implementations are a minor language wart, and we should fix them somehow. Is it possible to get a crater run for the PR to see if this theoretical breakage exists in practice? I'm happy to rebase this if the original owner is unavailable. |
Following up on this (I missed #89771 (comment) in my notifications) now -- it is somewhat unfortunate these impls do not exist, but I don't think the presented motivation is sufficiently strong to override the breaking change concern (which crater cannot really resolve). The specific pattern mentioned is fairly rare (bounding an associated type with Fn) and substituting a user-defined trait, perhaps one deref'ing to Fn, should work I think. |
Closing this based on #89771 (comment) |
This commit refers to the discussion in #89727
Please let me know if any further improvements are needed :)
Thanks!