-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 RFC 1789: Conversions from &mut T
to &Cell<T>
#43038
Comments
Implement rfc 1789: Conversions from `&mut T` to `&Cell<T>` I'm surprised that RFC 1789 has not been implemented for several months. Tracking issue: #43038 Please note: when I was writing tests for `&Cell<[i32]>`, I found it is not easy to get the length of the contained slice. So I designed a `get_with` method which might be useful for similar cases. This method is not designed in the RFC, and it certainly needs to be reviewed by core team. I think it has some connections with `Cell::update` #50186 , which is also in design phase.
This appears to have been implemented and is sitting behind the as_ref feature flag. Would anyone like to make any motions toward stabilization, or did the long discussion in the implementation PR cast doubts on the design? |
Let’s. @rfcbot fcp merge |
Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), 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. |
As I understand it, the new API here currently consists of: impl<T: ?Sized> Cell<T> {
pub fn from_mut(t: &mut T) -> &Cell<T>;
}
impl<T> Cell<[T]> {
pub fn as_slice_of_cells(&self) -> &[Cell<T>];
} |
All reactions
-
👍 4 reactions
Sorry, something went wrong.
Ping @BurntSushi @aturon @withoutboats do any of you have any concerns with merging this? |
All reactions
Sorry, something went wrong.
🔔 This is now entering its final comment period, as per the review above. 🔔 |
All reactions
Sorry, something went wrong.
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
All reactions
Sorry, something went wrong.
Stabilization PR: #61620 |
All reactions
Sorry, something went wrong.
Stabilize Cell::from_mut and as_slice_of_cells FCP: #43038 (comment)
Stabilized in #61620. |
All reactions
Sorry, something went wrong.
Does someone want to edit the description to check the stabilization checkbox? |
All reactions
Sorry, something went wrong.
Sure, though IMO the issue being closed already reflects that everything in it is either done or obsolete. |
All reactions
Sorry, something went wrong.
Why doesn't this return |
All reactions
-
👀 2 reactions
Sorry, something went wrong.
Is there a case where this would be useful? I feel that having multiple references to the thing is the point of this API. |
All reactions
Sorry, something went wrong.
You can trivially convert a |
All reactions
Sorry, something went wrong.
Is there a way to go from |
All reactions
Sorry, something went wrong.
Sorry, something went wrong.
So that's the reason why this should return |
All reactions
Sorry, something went wrong.
This discussion is somewhat academic since
|
All reactions
Sorry, something went wrong.
I see what you mean. This is a tool for allowing temporary usage through a |
All reactions
Sorry, something went wrong.
No branches or pull requests
This is a tracking issue for the RFC "Conversions from
&mut T
to&Cell<T>
" (rust-lang/rfcs#1789).Steps:
The text was updated successfully, but these errors were encountered: