Missed optimization opportunity when trivially converting between tuple struct and field struct by field values #135787
Labels
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.
Example code:
In rustc 1.84 stable this generates a number of moves that I don't think need to be there, especially when inlining:
See https://rust.godbolt.org/z/3sG9nz3oc
While this is a pretty pointless example, this comes up in situations where you might want to convert a tuple of slices into a struct of slices in order to assign names to the tuple members (I've been running into these issues working on gecs).
See also: #107436 and #135786
The text was updated successfully, but these errors were encountered: