-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Tracking issue for Rc::downcast (rc_downcast
feature)
#44608
Comments
Looks good to me to stabilize. @rfcbot fcp merge |
Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged teams: Concerns: Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
@rfcbot concern arc We should add to |
On the implementation PR:
We can still do that. |
Indeed! |
Hehe, I can't quite find the right way to pick the right implementations. All four combinations are "Trait", "Trait + Send", "Trait + Sync", "Trait + Send + Sync". The frugal approach is just the first one for Rc and just the last one for Arc. The perfect would be to write just one that covered them all, for each of Rc and Arc. I think the pragmatic would be all four for both Rc and Arc. |
@bluss I'd be ok conservatively just doing |
Hi! I ran into this today. Any objections if I put together a PR for |
SGTM |
Should I reuse this issue and |
Using the same tracking issue sounds fine: it’s a identical copy of a fairly small function. By the way, I think you can also remove an |
I also need to add |
We only need to implement it for `Any + Send + Sync` because in practice that's the only useful combination for `Arc` and `Any`. Implementation for rust-lang#44608 under the `rc_downcast` feature.
Arc downcast Implement `downcast` for `Arc<Any + Send + Sync>` as part of #44608, and gated by the same `rc_downcast` feature. This PR is mostly lightly-edited cut'n'paste. This has two additional changes: - The `downcast` implementation needs `Any + Send + Sync` implementations for `is` and `Debug`, and I added `downcast_ref` and `downcast_mut` for completeness/consistency. (Can these be insta-stabilized?) - At @SimonSapin's suggestion, I converted `Arc` and `Rc` to use `NonNull::cast` to avoid an `unsafe` block in each which tidied things up nicely.
Hmm it looks like only @alexcrichton can tell rfcbot to resolve the concern here, but I think we can consider the spirit of the process to be satisfied (if not the letter) and I would accept a stabilization PR. (Alex is away for a month.) |
@rfcbot resolved arc |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
…crum Stabilize rc_downcast Fixes rust-lang#44608
Tracking issue for the
Rc::downcast
method implemented in #44273The text was updated successfully, but these errors were encountered: