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

Add replace and swap functions to RefCell #2057

Merged
merged 2 commits into from
Jul 31, 2017

Conversation

notriddle
Copy link
Contributor

@notriddle notriddle changed the title Create an RFC for RefCell::replace() Add a RefCell::replace() function Jul 5, 2017
@notriddle notriddle changed the title Add a RefCell::replace() function Add replace and swap functions to RefCell Jul 5, 2017
@TimNN
Copy link
Contributor

TimNN commented Jul 6, 2017

Would try_replace and try_swap be added as well, analogous to try_borrow and try_borrow_mut?

@notriddle
Copy link
Contributor Author

That's not part of the RFC.

Since the only way you can make the swap and replace functions trigger is by doing them at the same time as a borrow, I don't think you need the try variants that often.

@aturon aturon added the T-libs-api Relevant to the library API team, which will review and decide on the RFC. label Jul 14, 2017
@aturon aturon self-assigned this Jul 14, 2017
@aturon
Copy link
Member

aturon commented Jul 14, 2017

This looks great! I'm going to go ahead and propose to merge.

@rfcbot fcp merge

@rfcbot
Copy link
Collaborator

rfcbot commented Jul 14, 2017

Team member @aturon has proposed to merge this. The next step is review by the rest of the tagged teams:

No concerns currently listed.

Once these reviewers reach consensus, 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 rfcbot added the proposed-final-comment-period Currently awaiting signoff of all team members in order to enter the final comment period. label Jul 14, 2017
@rfcbot
Copy link
Collaborator

rfcbot commented Jul 19, 2017

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot added final-comment-period Will be merged/postponed/closed in ~10 calendar days unless new substational objections are raised. and removed proposed-final-comment-period Currently awaiting signoff of all team members in order to enter the final comment period. labels Jul 19, 2017
@rfcbot
Copy link
Collaborator

rfcbot commented Jul 19, 2017

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot
Copy link
Collaborator

rfcbot commented Jul 29, 2017

The final comment period is now complete.

@alexcrichton alexcrichton merged commit 87042ba into rust-lang:master Jul 31, 2017
@alexcrichton
Copy link
Member

Ok looks like not much new discussion came up during FCP, so merging! I've opened a tracking issue at rust-lang/rust#43570. Thanks again for the RFC @notriddle!

@notriddle notriddle deleted the refcell_replace branch July 31, 2017 16:02
@notriddle notriddle restored the refcell_replace branch July 31, 2017 16:33
@Centril Centril added the A-cell Proposals relating to interior mutability. label Nov 23, 2018
@notriddle notriddle deleted the refcell_replace branch January 23, 2020 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cell Proposals relating to interior mutability. final-comment-period Will be merged/postponed/closed in ~10 calendar days unless new substational objections are raised. T-libs-api Relevant to the library API team, which will review and decide on the RFC.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants