about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-08-10 09:28:25 -0700
committerGitHub <noreply@github.com>2022-08-10 09:28:25 -0700
commiteff71b9927a98900ace67494fb9b1cb45a3b80a5 (patch)
tree969be2fcbe825df2c156e86fcd433c02fce05394 /compiler/rustc_codegen_llvm/src
parent96fc9f177e37f560787e37b8fee4e1dd772b6bfa (diff)
parentde95117ea8480ad6f5be175de8a1348b09970153 (diff)
downloadrust-eff71b9927a98900ace67494fb9b1cb45a3b80a5.tar.gz
rust-eff71b9927a98900ace67494fb9b1cb45a3b80a5.zip
Rollup merge of #100371 - xfix:inline-from-bytes-with-nul-unchecked-rt-impl, r=scottmcm
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`.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions