about summary refs log tree commit diff
path: root/tests/codegen/integer-overflow.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-02-08 21:37:24 +0100
committerGitHub <noreply@github.com>2025-02-08 21:37:24 +0100
commit785a4eb2d2f9da11c6ece504a00e2097ebab74c9 (patch)
treeb9f16792e0b021cddf560f48f82d39b8495b53ff /tests/codegen/integer-overflow.rs
parent02b8bea0849f982a480d80487b376204f658942b (diff)
parente090db8d226ab23f64d57ab1b56b999f6e4097fd (diff)
downloadrust-785a4eb2d2f9da11c6ece504a00e2097ebab74c9.tar.gz
rust-785a4eb2d2f9da11c6ece504a00e2097ebab74c9.zip
Rollup merge of #136099 - Kijewski:pr-rc-str-default, r=ibraheemdev
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.`
Diffstat (limited to 'tests/codegen/integer-overflow.rs')
0 files changed, 0 insertions, 0 deletions