about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/back/write.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-10-11 14:11:45 +0200
committerGitHub <noreply@github.com>2021-10-11 14:11:45 +0200
commit96ffc74fe3f7dfc85d165d08b040634ce9400e33 (patch)
treedff03f4122cf0b6f2fd61862b5e04adf542a2919 /compiler/rustc_codegen_llvm/src/back/write.rs
parent9183942e8383b4a2c40f8eeb872c71ab3d8c60fe (diff)
parentcf2bcd10ed28b169b8df74383c2a35a4ffbdcf40 (diff)
downloadrust-96ffc74fe3f7dfc85d165d08b040634ce9400e33.tar.gz
rust-96ffc74fe3f7dfc85d165d08b040634ce9400e33.zip
Rollup merge of #89753 - jkugelman:must-use-from_value-conversions, r=joshtriplett
Add #[must_use] to from_value conversions

I added two methods to the list myself. Clippy did not flag them because they take `mut` args, but neither modifies their argument.

```rust
core::str           const unsafe fn from_utf8_unchecked_mut(v: &mut [u8]) -> &mut str;
std::ffi::CString   unsafe fn from_raw(ptr: *mut c_char) -> CString;
```

I put a custom note on `from_raw`:

```rust
#[must_use = "call `drop(from_raw(ptr))` if you intend to drop the `CString`"]
pub unsafe fn from_raw(ptr: *mut c_char) -> CString {
```

Parent issue: #89692

r? ``@joshtriplett``
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/back/write.rs')
0 files changed, 0 insertions, 0 deletions