diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-10-11 14:11:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-11 14:11:45 +0200 |
| commit | 96ffc74fe3f7dfc85d165d08b040634ce9400e33 (patch) | |
| tree | dff03f4122cf0b6f2fd61862b5e04adf542a2919 /compiler/rustc_codegen_llvm/src/back/write.rs | |
| parent | 9183942e8383b4a2c40f8eeb872c71ab3d8c60fe (diff) | |
| parent | cf2bcd10ed28b169b8df74383c2a35a4ffbdcf40 (diff) | |
| download | rust-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
