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

Forget Waker when cloning LocalWaker #52640

Merged
merged 1 commit into from
Jul 24, 2018
Merged

Forget Waker when cloning LocalWaker #52640

merged 1 commit into from
Jul 24, 2018

Conversation

Thomasdezeeuw
Copy link
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
Collaborator

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-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 23, 2018
@joshtriplett
Copy link
Member

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

@dtolnay
Copy link
Member

dtolnay commented Jul 23, 2018

r? @cramertj

@cramertj
Copy link
Member

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

@bors r+

@bors
Copy link
Contributor

bors commented Jul 23, 2018

📌 Commit 89495f3 has been approved by cramertj

@bors bors 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.

Closes rust-lang#52629.
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:master Jul 24, 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
pietroalbini added a commit to pietroalbini/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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: 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