-
Notifications
You must be signed in to change notification settings - Fork 19
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
ACP: Implement Fn
traits for Rc
and Arc
#143
Comments
Fn
traits for Rc
and Arc
Fn
traits for Rc
and Arc
It seems this may be a breaking change without specialization https://github.com/rust-lang/rust/actions/runs/3636798670/jobs/6137112313#step:26:606. 😞 |
Already requested and rejected at least twice in the past: |
Thanks for the links. I guess we can add this to the Rust 2.0 bucket list. |
To be fair, the ACP process did not exist at the time. Maybe it's a good place to start gathering legitimate use cases and potential breaking concerns? There are some but scattered in the different PRs. |
I don't see how an edition change can fix this unless specialization is stabilized and made automatic. |
I think the others attempts were not facing issues with specialization but rather with |
Proposal
Problem statement
It is not possible to pass reference-counted closures to APIs that take
Fn + 'static
orFn + Clone
.Motivation, use-cases
Many server APIs expect
'static
lifetimes but some logic may be implemented in a single closure that's reused in other places. Currently this would require moving captured values and invokingClone
on the closure itself, which clones captured values.Solution sketches
Alternative solutions: none.
Links and related work
Implementation: rust-lang/rust#105414
What happens now?
This issue is part of the libs-api team API change proposal process. Once this issue is filed the libs-api team will review open proposals in its weekly meeting. You should receive feedback within a week or two.
The text was updated successfully, but these errors were encountered: