Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for RefCell::{replace, swap} #43570
Comments
alexcrichton
added
B-RFC-approved
T-libs
labels
Jul 31, 2017
alexcrichton
referenced this issue
Jul 31, 2017
Merged
Add replace and swap functions to RefCell #2057
This comment has been minimized.
This comment has been minimized.
|
Can I implement this? (I understand you'll want to give it the C-assigned label, to make sure nobody else works on it) |
This comment has been minimized.
This comment has been minimized.
|
Certainly! |
notriddle
referenced this issue
Jul 31, 2017
Merged
Implement `RefCell::replace` and `RefCell::swap` #43574
Mark-Simulacrum
added
the
C-tracking-issue
label
Aug 1, 2017
bors
added a commit
that referenced
this issue
Aug 14, 2017
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
|
The only docs needed for this is the API docs. I've also written PR #45819 to add a |
This comment has been minimized.
This comment has been minimized.
gbip
commented
Dec 5, 2017
|
Is there any plan to make this stable ? I can't figure the syntax to move a value inside a RefCell to replace the old one. |
kennytm
added a commit
to kennytm/rust
that referenced
this issue
Dec 20, 2017
This comment has been minimized.
This comment has been minimized.
|
Stabilized in #46517 |
alexcrichton
closed this
Mar 1, 2018
This comment has been minimized.
This comment has been minimized.
|
Let’s stabilize it now, perhaps with the “corresponds to @rfcbot fcp merge |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Mar 17, 2018
•
|
Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged team members: 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. |
SimonSapin
reopened this
Mar 17, 2018
rfcbot
added
the
proposed-final-comment-period
label
Mar 17, 2018
This comment has been minimized.
This comment has been minimized.
|
@rfcbot concern footgun I'd personally be somewhat concerned about the |
This comment has been minimized.
This comment has been minimized.
|
I'm also under the impression that this isn't a massively used method in the sense that the ergonomic win here isn't necessary critical, but I could be wrong! |
This comment has been minimized.
This comment has been minimized.
|
I sent the PR for it because I wrote the function freely in my own code where I wanted to recurse through a path in a tree without passing a Vec of RefCell borrows but rather keep the borrow information in the stack. Putting a warning that the RefCell is borrowed for the duration of the closure into the documentation would help. |
This comment has been minimized.
This comment has been minimized.
|
@SimonSapin do you have thoughts on the concern I listed above? I'm not personally a huge fan of a warning in the sense that I don't think it absolves us of the footgun of the API, but if there's a strong use case for adding it then the warning is likely enough. I do not currently see, however, the strong use case for adding this |
Centril
added
the
disposition-merge
label
May 24, 2018
This comment has been minimized.
This comment has been minimized.
|
This has been merged. Tracking issue can be closed. |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Ah. I thought that would be a different issue, because it's not in the title and not in the RFC. Sorry. |
This comment has been minimized.
This comment has been minimized.
|
@rfcbot resolve footgun I don't want to personally be on the hook for blocking this any more |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Feb 20, 2019
|
|
rfcbot
added
the
final-comment-period
label
Feb 20, 2019
rfcbot
removed
the
proposed-final-comment-period
label
Feb 20, 2019
rfcbot
added
finished-final-comment-period
and removed
final-comment-period
labels
Mar 2, 2019
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Mar 2, 2019
|
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. |
jonas-schievink
added
B-unstable
B-RFC-implemented
labels
Mar 24, 2019
This comment has been minimized.
This comment has been minimized.
|
Seems like this just needs a stabilization PR now? |
alexcrichton commentedJul 31, 2017
•
edited by jonas-schievink
Tracking issue for rust-lang/rfcs#2057