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 9 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
|
r? @TaKO8Ki rustbot has assigned @TaKO8Ki. Use Why was this reviewer chosen?The reviewer was selected based on:
|
a352f9d to
9030bb9
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. |
9030bb9 to
3bb21d4
Compare
This comment has been minimized.
This comment has been minimized.
…ottmcm Don't try to remove `drop_in_place` calls in `RemoveUnneededDrops` As per my justification in #154327 (comment) r? scottmcm
tests/mir-opt/inline/inline_empty_drop_glue.slice_in_place.Inline.diff
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
…ottmcm Don't try to remove `drop_in_place` calls in `RemoveUnneededDrops` As per my justification in rust-lang/rust#154327 (comment) r? scottmcm
b8934ff to
e3aaa43
Compare
|
(#155044 is merged, ci is passing, this PR is ready for review again :3) |
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