mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
![]() Optimize `Rc::<str>::default()` implementation This PR lets `impl Default for Rc<str>` re-use the implementation for `Rc::<[u8]>::default()`. The previous version only calculted the memory layout at runtime, even though it should be known at compile time, resulting in an additional function call. The same optimization is done for `Rc<CStr>`. Generated byte code: <https://godbolt.org/z/dfq73jsoP>. Resolves <https://github.com/rust-lang/rust/issues/135784>. Cc `@Billy-Sheppard.` |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
Cargo.toml |