Drop with guaranteed move elision #62508
Labels
A-destructors
Area: Destructors (`Drop`, …)
A-MIR
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
C-optimization
Category: An issue highlighting optimization opportunities or PRs implementing such
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Today, calling
drop(_1)
results in the following MIR:We could instead inline this directly to a MIR drop, with no move. This makes it simpler to do some optimizations in MIR.
This issue specifically tracks having such a
drop
available in HIR lowering; whether or not to blessstd::mem::drop
with this guarantee is up for discussion.cc @cramertj @withoutboats
The text was updated successfully, but these errors were encountered: