rust/library
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
..
alloc Rollup merge of #89753 - jkugelman:must-use-from_value-conversions, r=joshtriplett 2021-10-11 14:11:45 +02:00
backtrace@cc89bb66f9 Update the backtrace crate 2021-09-15 20:32:35 +02:00
core Rollup merge of #89753 - jkugelman:must-use-from_value-conversions, r=joshtriplett 2021-10-11 14:11:45 +02:00
panic_abort Add SOLID targets 2021-09-28 11:31:47 +09:00
panic_unwind Add SOLID targets 2021-09-28 11:31:47 +09:00
proc_macro Stabilize proc_macro::is_available 2021-10-10 14:09:54 +02:00
profiler_builtins rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rtstartup
rustc-std-workspace-alloc rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rustc-std-workspace-core rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rustc-std-workspace-std rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
std Rollup merge of #89753 - jkugelman:must-use-from_value-conversions, r=joshtriplett 2021-10-11 14:11:45 +02:00
stdarch@5fdbc476af Update stdarch submodule 2021-09-21 11:24:08 +02:00
test Rollup merge of #89082 - smoelius:master, r=kennytm 2021-10-07 20:26:12 -07:00
unwind Add new target armv7-unknown-linux-uclibceabihf 2021-10-06 14:33:13 +00:00