mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-21 11:23:03 +00:00
![]() Try to avoid locals when cloning into Box/Rc/Arc 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. The same applies to `Rc`/`Arc::make_mut` when they must clone the data. |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
Cargo.toml |