-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Conversation
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.
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. |
I'm not the appropriate reviewer for this; could someone from @rust-lang/libs take a look, please? |
r? @cramertj |
Ick, this is pretty nasty. I'm surprised I didn't hit this earlier. Good catch, @Thomasdezeeuw! @bors r+ |
📌 Commit 89495f3 has been approved by |
… 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.
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
…, 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
…, 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
…, 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
…, 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
…, 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
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.