rust/library/alloc
Guillaume Gomez 96ffc74fe3
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``
2021-10-11 14:11:45 +02:00
..
benches Rollup merge of #88452 - xu-cheng:vecdeque-from-array, r=m-ou-se 2021-10-04 13:58:08 -07:00
src Rollup merge of #89753 - jkugelman:must-use-from_value-conversions, r=joshtriplett 2021-10-11 14:11:45 +02:00
tests Rollup merge of #87993 - kornelski:try_reserve_stable, r=joshtriplett 2021-10-04 21:12:33 -07:00
Cargo.toml rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00