Skip to content

Forget Waker when cloning LocalWaker - #52640

Merged
bors merged 1 commit into
rust-lang:masterfrom
Thomasdezeeuw:fix-localwaker-clone
Jul 24, 2018
Merged

Forget Waker when cloning LocalWaker#52640
bors merged 1 commit into
rust-lang:masterfrom
Thomasdezeeuw:fix-localwaker-clone

Conversation

@Thomasdezeeuw

Copy link
Copy Markdown
Contributor

Since NonNull is Copy the inner field of the cloned Waker was copied for
use in the new LocalWaker, however this left Waker to be dropped. Which
means that when cloning LocalWaker would also erroneously call drop_raw.

This change forgets the Waker, rather then dropping it, leaving the
inner field to be used by the returned LocalWaker.

Closes#52629.

Since NonNull is Copy the inner field of the cloned Waker was copied for
use in the new LocalWaker, however this left Waker to be dropped. Which
means that when cloning LocalWaker would also erroneously call drop_raw.
This change forgets the Waker, rather then dropping it, leaving the
inner field to be used by the returned LocalWaker.
Closes#52629.
@rust-highfive

Copy link
Copy Markdown
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @joshtriplett (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.

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 23, 2018
@joshtriplett

Copy link
Copy Markdown
Member

I'm not the appropriate reviewer for this; could someone from @rust-lang/libs take a look, please?

@dtolnay

Copy link
Copy Markdown
Member

r? @cramertj

@cramertj

Copy link
Copy Markdown
Member

Ick, this is pretty nasty. I'm surprised I didn't hit this earlier. Good catch, @Thomasdezeeuw!

@bors r+

@bors

bors commented Jul 23, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit 89495f3 has been approved by cramertj

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 23, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Jul 24, 2018
… r=cramertj
Forget Waker when cloning LocalWaker
Since NonNull is Copy the inner field of the cloned Waker was copied for
use in the new LocalWaker, however this left Waker to be dropped. Which
means that when cloning LocalWaker would also erroneously call drop_raw.
This change forgets the Waker, rather then dropping it, leaving the
inner field to be used by the returned LocalWaker.
Closesrust-lang#52629.
@kennytmkennytm mentioned this pull request Jul 24, 2018
bors added a commit that referenced this pull request Jul 24, 2018
Rollup of 10 pull requests
Successful merges:
- #52538 (Remove obsolete flags in the i586_musl Dockerfile)
- #52548 (Cursor: update docs to clarify Cursor only works with in-memory buffers)
- #52605 (Do not suggest using `to_owned()` on `&str += &str`)
- #52621 (Fix color detection for Windows msys terminals.)
- #52622 (Use MultiSpan in E0707 and E709)
- #52627 (Compile rustc before building tests for rustdoc)
- #52637 (Don't use NonNull::dangling as sentinel value in Rc, Arc)
- #52640 (Forget Waker when cloning LocalWaker)
- #52641 (Simplify 2 functions in rustc_mir/dataflow)
- #52642 (Replace a few expect+format combos with unwrap_or_else+panic)
Failed merges:
r? @ghost
@bors
bors merged commit 89495f3 into rust-lang:masterJul 24, 2018
@MajorBreakfastMajorBreakfast mentioned this pull request Jul 29, 2018
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jul 30, 2018
…, r=cramertj
Fix From<LocalWaker>
This is a follow-up to rust-lang#52640
Fixes `From<LocalWaker>` which is affected by the same accidental drop bug (unless I'm totally mistaken)
r? @cramertj
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jul 30, 2018
…, r=cramertj
Fix From<LocalWaker>
This is a follow-up to rust-lang#52640
Fixes `From<LocalWaker>` which is affected by the same accidental drop bug (unless I'm totally mistaken)
r? @cramertj
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jul 31, 2018
…, r=cramertj
Fix From<LocalWaker>
This is a follow-up to rust-lang#52640
Fixes `From<LocalWaker>` which is affected by the same accidental drop bug (unless I'm totally mistaken)
r? @cramertj
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Aug 1, 2018
…, r=cramertj
Fix From<LocalWaker>
This is a follow-up to rust-lang#52640
Fixes `From<LocalWaker>` which is affected by the same accidental drop bug (unless I'm totally mistaken)
r? @cramertj
emilyalbini added a commit to emilyalbini/rust that referenced this pull request Aug 1, 2018
…, r=cramertj
Fix From<LocalWaker>
This is a follow-up to rust-lang#52640
Fixes `From<LocalWaker>` which is affected by the same accidental drop bug (unless I'm totally mistaken)
r? @cramertj
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@Thomasdezeeuw@rust-highfive@joshtriplett@dtolnay@cramertj@bors