change the type of the argument of drop_in_place lang item to &mut _#154327
change the type of the argument of drop_in_place lang item to &mut _#154327WaffleLapkin wants to merge 11 commits intorust-lang:mainfrom
drop_in_place lang item to &mut _#154327Conversation
|
Oh wow I hadn't expected my wish to be fulfilled before I could even finish my PR that motivated me to express the wish in the first place. :-) ❤️ |
This comment has been minimized.
This comment has been minimized.
281786e to
4842194
Compare
This comment has been minimized.
This comment has been minimized.
794fcf5 to
ea0c913
Compare
This comment has been minimized.
This comment has been minimized.
ea0c913 to
3dda404
Compare
This comment has been minimized.
This comment has been minimized.
3dda404 to
32510c2
Compare
This comment has been minimized.
This comment has been minimized.
|
I like the interpreter changes and renames. Not sure what the status of the rest of the PR is, but if you submit just those as a separate PR I'll r+. |
32510c2 to
487fcc4
Compare
This comment has been minimized.
This comment has been minimized.
487fcc4 to
6e43096
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…s, r=RalfJung Slightly refactor mplace<->ptr conversions split off of rust-lang#154327 r? RalfJung
…ottmcm Don't try to remove `drop_in_place` calls in `RemoveUnneededDrops` As per my justification in rust-lang/rust#154327 (comment) r? scottmcm
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Looking over the changes in the async part again -- they seem fairly mechanical, and I assume there's some sort of MIR validation / typeck running which ensures that the types all match. So I'd be happy to sign off on these.
What I really don't know how to review are the gigantic mir-opt test suite diffs. How do you all usually deal with that? @rust-lang/wg-mir-opt @scottmcm @saethlin
| ); | ||
| println!("AsyncUnion::Dropper::poll: {}, {}", unsafe { self.signed }, unsafe { | ||
| self.unsigned | ||
| },); |
There was a problem hiding this comment.
It'd be better to avoid formatting-only changes... and in particular this one here doesn't like it is properly formatted now? This looked a lot better before.
mir-opt diffs look good to me. Most of the diff here is from tests that check that drop-related code is inlined (it is) and then there's a bunch of diff in the specifics of the SourceScope data for PreCodegen tests, and those tests aren't worried about debuginfo. If you can visually exclude those cases, the diff isn't too bad. Also for what it's worth I don't have a lot of patience for these mir-opt diffs for this reason, we have support for FileCheck annotations in mir-opt tests. If something is really that critical, it should be tested for with FileCheck. |
It should, yeah, but is it?^^ Thanks for taking a look. :) @WaffleLapkin looks like we're just one rebase and a few nits away from landing this then. :D |
Co-authored-by: Ralf Jung <post@ralfj.de>
222a3a5 to
e8c5b90
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@RalfJung rebased + addressed the nits :) |
This comment has been minimized.
This comment has been minimized.
e8c5b90 to
f1a1b8e
Compare
|
@bors r=RalfJung,scottmcm,saethlin rollup=never |
|
Actually... |
|
This pull request was unapproved. |
View all comments
We used to special case
core::ptr::drop_in_placewhen computing LLVM argument attributes with this hack:rust/compiler/rustc_ty_utils/src/abi.rs
Lines 383 to 392 in db5e2dc
This is because even though
drop_in_placetakes a*mut Tit is semantically a&mut T(remember how&mut Selfis passed toDrop::drop). This is apparently relevant for perf.This PR replaces this hack with a simpler solution -- it makes
drop_in_placea thin wrapper around newly addedcore::ptr::drop_glue, which is the actual lang item and takes a&mut T:rust/library/core/src/ptr/mod.rs
Lines 810 to 833 in d2563d5
The rest of the PR is blessing tests and cleaning up things which are not necessary after this change.
One thing that is a bit awkward is that now that
drop_glueis the actual lang item, a lot of the comments referring todrop_in_placeare outdated. Should I try fixing that?I've also changed
async_drop_in_placeto take a&mut T, and it simplified the code handling it a bit. (since it's unstable we don't need to introduce a wrapper)cc @RalfJung
Closes #154274