mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-17 03:16:15 +00:00
For generic `T: Clone`, we can allocate an uninitialized box beforehand, which gives the optimizer a chance to create the clone directly in the heap. For `T: Copy`, we can go further and do a simple memory copy, regardless of optimization level.