-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-mir-optArea: MIR optimizationsArea: MIR optimizationsC-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Noticed this looking at #139415.
We already do this for !needs_drop
types, but std::array::IntoIter<&mut usize, 1>
does have a Drop
, and thus needs_drop
is true because it's not trivially obvious that the Drop::drop
won't actually do anything.
But if you look at https://rust.godbolt.org/z/raWrq6rsY you can see that we're emitting the call to the drop.
This probably is about inlining drop shims in MIR? Might be another way, though, if somehow we could notice in cg_ssa.
Metadata
Metadata
Assignees
Labels
A-mir-optArea: MIR optimizationsArea: MIR optimizationsC-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.