Current state of in-place initialization
Current state of in-place initialization
Posted Oct 10, 2026 7:08 UTC (Sat) by donald.buczek (subscriber, #112892)In reply to: Current state of in-place initialization by NYKevin
Parent article: An update on Rust's project goals
Would it be possible for the compiler to optimize the copy of a new objects bits into an in-place initialization? Doesn't this already happen under some conditions? If so, could that be expanded? Would it be possible that we could have a mechanism to specify the expectation that this optimization applies in the source code making the compiler throw an error if it is unable?
Just thoughts, maybe nonsense....
