mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
eff71b9927
Inline CStr::from_bytes_with_nul_unchecked::rt_impl Currently `CStr::from_bytes_with_nul_unchecked::rt_impl` is not being inlined. The following function: ```rust pub unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) { CStr::from_bytes_with_nul_unchecked(bytes); } ``` Outputs the following assembly on current nightly ```asm example::from_bytes_with_nul_unchecked: jmp qword ptr [rip + _ZN4core3ffi5c_str4CStr29from_bytes_with_nul_unchecked7rt_impl17h026f29f3d6a41333E@GOTPCREL] ``` Meanwhile on beta this provides the following assembly: ```asm example::from_bytes_with_nul_unchecked: ret ``` This pull request adds `#[inline]` annotation to`rt_impl` to fix a code generation regression for `CStr::from_bytes_with_nul_unchecked`. |
||
---|---|---|
.. | ||
benches | ||
primitive_docs | ||
src | ||
tests | ||
Cargo.toml |