rust/library/std/src/io
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
..
buffered Auto merge of #89755 - jkugelman:must-use-conversions-that-move-self, r=joshtriplett 2021-10-11 07:27:44 +00:00
cursor Make some std::io functions const 2020-11-06 17:48:26 +01:00
error Add test for io::Error::new_const. 2021-03-21 20:22:26 +01:00
impls std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
stdio stdio_locked: updates based on feedback 2021-07-02 15:56:56 -05:00
util specialize io::copy to use the memory of the writer if it is a BufWriter 2021-01-31 14:58:03 +01:00
copy.rs library: Normalize safety-for-unsafe-block comments 2021-02-24 06:13:42 +01:00
cursor.rs Add functions to add unsigned and signed integers 2021-10-01 19:08:13 +02:00
error.rs Rollup merge of #89753 - jkugelman:must-use-from_value-conversions, r=joshtriplett 2021-10-11 14:11:45 +02:00
impls.rs Forwarding implementation for Seek trait's stream_position method 2021-06-07 19:21:22 -04:00
mod.rs Add #[must_use] to core and std constructors 2021-10-10 02:44:26 -04:00
prelude.rs Use heading for std::prelude and not io::prelude 2021-01-05 17:52:24 -08:00
stdio.rs Add #[must_use] to conversions that move self 2021-10-10 19:50:52 -04:00
tests.rs Optimize File::read_to_end and read_to_string 2021-10-07 18:42:02 -04:00
util.rs Apply 16 commits (squashed) 2021-09-25 20:04:35 +02:00