Skip to content
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

aturon opened this Issue Jul 3, 2017 · 4 comments


None yet
6 participants
Copy link

aturon commented Jul 3, 2017

This is a tracking issue for the RFC "Conversions from &mut T to &Cell<T>" (rust-lang/rfcs#1789).


bors added a commit that referenced this issue Jul 23, 2018

Auto merge of #50494 - F001:as_cell, r=alexcrichton
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 comment has been minimized.

Copy link

bstrie commented Nov 13, 2018

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?


This comment has been minimized.

Copy link

SimonSapin commented Apr 7, 2019


@rfcbot fcp merge


This comment has been minimized.

Copy link

rfcbot commented Apr 7, 2019

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.


This comment has been minimized.

Copy link

dtolnay commented Apr 7, 2019

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>];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.