Open
Description
Today, calling drop(_1)
results in the following MIR:
_2 = move _1;
std::mem::drop::<T>(_2) -> [return .., unwind ..];
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 bless std::mem::drop
with this guarantee is up for discussion.
Metadata
Metadata
Assignees
Labels
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: Destructors (`Drop`, …)Category: An issue proposing an enhancement or a PR with one.Category: An issue highlighting optimization opportunities or PRs implementing suchRelevant to the compiler team, which will review and decide on the PR/issue.