Uh oh!
There was an error while loading. Please reload this page.
Add swap method for Cell - #39716
Conversation
rust-highfive
commented
Feb 10, 2017
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
There was a problem hiding this comment.
The value in other is currently garbage and this will drop it.
You could do mem::forget(other.replace(s)), or this function could just be unsafe { ptr::swap(self.as_ptr(), other.as_ptr()); } (after the pointer equality check of course)
ghost
commented
Feb 10, 2017
Oh it looks like |
alexcrichton
commented
Feb 11, 2017
Thanks for the PR @F001! This seems like reasonable functionality to me. Thoughts @rust-lang/libs? |
BurntSushi
commented
Feb 11, 2017
I think this seems reasonable to me. Should this gets it own feature separate from |
F001
commented
Feb 11, 2017
@whataloadofwhat Thank you for your help! I was very busy yesterday, and submitted the code in a hurry. Even didn't try to compile. That's my fault! @BurntSushi Is "cell_swap" a reasonable name? Should I also open an issue to track this feature? |
Off the topic, I'm not sure the methods |
pitdicker
commented
Feb 11, 2017
I can't see why |
aturon
commented
Feb 11, 2017
This API seems good. I personally think it can go under the existing feature; it's almost certain to be stabilized together. We can always shard later if need be. |
alexcrichton
commented
Feb 12, 2017
@bors: r+ |
bors
commented
Feb 12, 2017
📌 Commit a5e8bbf has been approved by |
eddyb
commented
Feb 13, 2017
@bors rollup |
Add `swap` method for `Cell` Addition to rust-lang#39264 r? @alexcrichton
bors
commented
Feb 13, 2017
⌛ Testing commit a5e8bbf with merge f7c8beb... |
bors
commented
Feb 13, 2017
💔 Test failed - status-travis |
alexcrichton
commented
Feb 13, 2017
via email
| … On Mon, Feb 13, 2017 at 2:56 AM, bors ***@***.***> wrote:
💔 Test failed - status-travis
<https://travis-ci.org/rust-lang/rust/builds/201050096>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#39716 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD95Jk8vf1vyvf5UFMkY8YYOiRYPK4Mks5rcBqogaJpZM4L9JuV>
.
|
Add `swap` method for `Cell` Addition to rust-lang#39264 r? @alexcrichton
RalfJung
commented
Feb 13, 2017
I made a PR for this: #39793 |
glaebhoerl
commented
Feb 22, 2017
Hey, I was going to write an RFC for this. Apparently it didn't need one? |
aturon
commented
Feb 22, 2017
@glaebhoerl Yeah -- it's hard to draw a firm line here, but once we have a basic API surface (like the updated one for |
RalfJung
commented
Feb 22, 2017
The PR above is is insta-stable, isn't it? It is relaxing trait bounds of methods, AFAIK this can't even be flagged as unstable... |
alexcrichton
commented
Feb 22, 2017
@RalfJung oh in this case the method is tagged |
RalfJung
commented
Feb 22, 2017
One of the three is. The others are not. (I am talking just about my PR here, about what I quoted above -- not about |
alexcrichton
commented
Feb 22, 2017
Oh sorry, then yeah, those methods (with relaxed bounds) are instantly stable (the libs team discussed this though and is ok with that) |
Addition to #39264
r? @alexcrichton