rust/library/std/src/io
Matthias Krüger 26f505c433
Rollup merge of #90430 - jkugelman:must-use-std-a-through-n, r=joshtriplett
Add #[must_use] to remaining std functions (A-N)

I've run out of compelling reasons to group functions together across crates so I'm just going to go module-by-module. This is half of the remaining items from the `std` crate, from A-N.

I added these functions myself. Clippy predictably ignored the `mut` ones, but I don't know why the rest weren't flagged. Check them closely, please? Maybe I overlooked good reasons.

```rust
std::backtrace::Backtrace                                   const fn disabled() -> Backtrace;
std::backtrace::Backtrace<'a>                               fn frames(&'a self) -> &'a [BacktraceFrame];
std::collections::hash_map::RawOccupiedEntryMut<'a, K, V>   fn key_mut(&mut self) -> &mut K;
std::collections::hash_map::RawOccupiedEntryMut<'a, K, V>   fn get_mut(&mut self) -> &mut V;
std::collections::hash_map::RawOccupiedEntryMut<'a, K, V>   fn get_key_value(&mut self) -> (&K, &V);
std::collections::hash_map::RawOccupiedEntryMut<'a, K, V>   fn get_key_value_mut(&mut self) -> (&mut K, &mut V);
std::env                                                    fn var_os<K: AsRef<OsStr>>(key: K) -> Option<OsString>;
std::env                                                    fn split_paths<T: AsRef<OsStr> + ?Sized>(unparsed: &T) -> SplitPaths<'_>;
std::io::Error                                              fn get_mut(&mut self) -> Option<&mut (dyn error::Error + Send + Sync + 'static)>;
```

Parent issue: #89692

r? `@joshtriplett`
2021-10-31 13:20:06 +01: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 Add #[must_use] to remaining std functions (A-N) 2021-10-30 23:44:02 -04:00
impls.rs Forwarding implementation for Seek trait's stream_position method 2021-06-07 19:21:22 -04:00
mod.rs Rollup merge of #90430 - jkugelman:must-use-std-a-through-n, r=joshtriplett 2021-10-31 13:20:06 +01:00
prelude.rs Use heading for std::prelude and not io::prelude 2021-01-05 17:52:24 -08:00
stdio.rs Rollup merge of #90430 - jkugelman:must-use-std-a-through-n, r=joshtriplett 2021-10-31 13:20:06 +01:00
tests.rs Optimize File::read_to_end and read_to_string 2021-10-07 18:42:02 -04:00
util.rs Add #[must_use] to remaining std functions (A-N) 2021-10-30 23:44:02 -04:00