destructuring_assignment fails to optimize code as well as mem::swap #90699
Labels
C-bug
Category: This is a bug.
F-destructuring_assignment
`#![feature(destructuring_assignment)]`
I-slow
Issue: Problems and improvements with respect to performance of generated code.
Opening a new bug as requested in #90521 (comment)
I wanted to check how
(a,b) = (b,a)
compares tomem::swap,
it looks likemem::swap
applies optimizations whenT
is 32 bytes or bigger butdestructuring_assignment
doesn't.I tried this code:
https://godbolt.org/z/czfTv3nzW
I expected to see this happen:
Both function should generate the same (optimal) code
Instead, this happened:
mem::swap
applies optimizations whiledestructuring_assignment
doesn'tThe text was updated successfully, but these errors were encountered: