-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Stop clearing box's drop flags early #131146
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
Conversation
r? @wesleywiser rustbot has assigned @wesleywiser. Use |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
73ea6ab
to
6b9d6c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a "mir opt" test for elaborate drops that shows this behavior? (You can look at https://github.com/rust-lang/rust/blob/master/tests/mir-opt/elaborate_box_deref_in_debuginfo.rs for a similar kind of test)
35f68b9
to
1bd8217
Compare
@beepster4096 |
I forgot to @rustbot ready after responding to the review comments. Apologies. |
Thanks @beepster4096! @bors r+ |
…leywiser Stop clearing box's drop flags early Ever since rust-lang#100036, drop flags have been incorrectly cleared when destructors are called. This only does anything in a very specific case involving Box, leading to the fields of the Box not being dropped when they should. This PR fixes that. Fixes rust-lang#131082
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#131146 (Stop clearing box's drop flags early) - rust-lang#133810 (remove unnecessary `eval_verify_bound`) - rust-lang#134745 (Normalize each signature input/output in `typeck_with_fallback` with its own span) - rust-lang#134989 (Lower Guard Patterns to HIR.) - rust-lang#135149 (Use a post-monomorphization typing env when mangling components that come from impls) - rust-lang#135171 (rustdoc: use stable paths as preferred canonical paths) - rust-lang#135200 (rustfmt: drop nightly-gating of the `--style-edition` flag registration) r? `@ghost` `@rustbot` modify labels: rollup
@rustbot label A-box |
☔ The latest upstream changes (presumably #137030) made this pull request unmergeable. Please resolve the merge conflicts. |
@beepster4096 From wg-triage, Any updates on this PR? Thanks for your contribution. |
@LFS6502 No updates, still just needs that rollup failure investigated and a rebase. Only blocked on my capacity to do work. No ETA on that unfortunately. |
Closing, in favor of a rewritten PR I'll open soon |
… r=oli-obk Fix Box allocator drop elaboration New version of rust-lang#131146. Clearing Box's drop flag after running its destructor can cause it to skip dropping its allocator, so just don't. Its cleared by the drop ladder code afterwards already. Unlike the last PR this also handles other types with destructors properly, in the event that we can have open drops on them in the future (by partial initialization or DerefMove or something). Finally, I also added tests for the interaction with async drop here but I discovered rust-lang#143658, so one of the tests has a `knownbug` annotation. Not sure if it should be in this PR at all though. Fixes rust-lang#131082 r? wesleywiser - prev. reviewer
… r=oli-obk Fix Box allocator drop elaboration New version of rust-lang#131146. Clearing Box's drop flag after running its destructor can cause it to skip dropping its allocator, so just don't. Its cleared by the drop ladder code afterwards already. Unlike the last PR this also handles other types with destructors properly, in the event that we can have open drops on them in the future (by partial initialization or DerefMove or something). Finally, I also added tests for the interaction with async drop here but I discovered rust-lang#143658, so one of the tests has a `knownbug` annotation. Not sure if it should be in this PR at all though. Fixes rust-lang#131082 r? wesleywiser - prev. reviewer
Ever since #100036, drop flags have been incorrectly cleared when destructors are called. This only does anything in a very specific case involving Box, leading to the fields of the Box not being dropped when they should. This PR fixes that.
Fixes #131082