Skip to content

Simplify RefCell code a bit, make deref a no-op. #19386

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

Merged
merged 1 commit into from
Dec 5, 2014

Conversation

tbu-
Copy link
Contributor

@tbu- tbu- commented Nov 29, 2014

No description provided.

@rust-highfive
Copy link
Contributor

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

#[unstable]
pub fn static_borrow_mut<'a>(&'a mut self) -> &'a mut T {
unsafe { &mut *self.value.get() }
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now could we hold off on the addition of new functions to the API? I'd help speed up getting through the internal refactoring.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of the best features of @chris-morgan's new mucell library, and I would really love it to be on RefCell too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This functionality can actually be on all types with internal mutability (including the atomic types and Cell), so I think these could/should be added in a global manner. And then that PR can have the discussion about APIs and naming, to speed this one through.

(I raised this on discuss a while ago so I guess that thread could be reused for the API discussion/bikeshedding.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexcrichton
Really sorry (!) for the inconvenience, I thought I removed all new functions, this was supposed to be a change in internals only. I fixed it

@tbu-
Copy link
Contributor Author

tbu- commented Nov 30, 2014

I believe this failure wasn't caused by me.

@tbu-
Copy link
Contributor Author

tbu- commented Dec 3, 2014

@alexcrichton Can you re-r+? This test failure appears in other pull requests too, e.g. in the "Implement Clone for Cow".

@MatejLach
Copy link
Contributor

@tbu- Yeah, this happens a lot.
@alexcrichton said that he's working on a fix in his spare time.

@alexcrichton alexcrichton merged commit 5048953 into rust-lang:master Dec 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants