rust/library/std/src
Matthias Krüger 455a79acab
Rollup merge of #90431 - jkugelman:must-use-std-o-through-z, r=joshtriplett
Add #[must_use] to remaining std functions (O-Z)

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 O-Z.

`panicking::take_hook` has a side effect: it unregisters the current panic hook, returning it. I almost ignored it, but the documentation example shows `let _ = panic::take_hook();`, so following suit I went ahead and added a `#[must_use]`.

```rust
std::panicking   fn take_hook() -> Box<dyn Fn(&PanicInfo<'_>) + 'static + Sync + Send>;
```

I added these functions that clippy did not flag:

```rust
std::path::Path   fn starts_with<P: AsRef<Path>>(&self, base: P) -> bool;
std::path::Path   fn ends_with<P: AsRef<Path>>(&self, child: P) -> bool;
std::path::Path   fn with_file_name<S: AsRef<OsStr>>(&self, file_name: S) -> PathBuf;
std::path::Path   fn with_extension<S: AsRef<OsStr>>(&self, extension: S) -> PathBuf;
```

Parent issue: #89692

r? `@joshtriplett`
2021-10-31 13:20:07 +01:00
..
backtrace Add Frames iterator for Backtrace 2021-01-23 11:56:33 -06:00
collections Rollup merge of #90430 - jkugelman:must-use-std-a-through-n, r=joshtriplett 2021-10-31 13:20:06 +01:00
env std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
error std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
f32 Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
f64 Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
ffi Rollup merge of #90430 - jkugelman:must-use-std-a-through-n, r=joshtriplett 2021-10-31 13:20:06 +01:00
fs Make sure CreateDirectoryW works for path lengths > 247 2021-10-23 19:35:24 +01:00
io Rollup merge of #90430 - jkugelman:must-use-std-a-through-n, r=joshtriplett 2021-10-31 13:20:06 +01:00
lazy Upgrade wasm32 image to Ubuntu 20.04 2021-02-06 13:05:56 +01:00
net Add #[must_use] to remaining std functions (A-N) 2021-10-30 23:44:02 -04:00
num rustc_expand: Mark inner #![test] attributes as soft-unstable 2020-11-20 19:35:03 +03:00
os Rollup merge of #90431 - jkugelman:must-use-std-o-through-z, r=joshtriplett 2021-10-31 13:20:07 +01:00
panic review: fix nits and move panic safety tests to the correct place 2020-09-25 23:10:24 +02:00
path Ensure that pushing empty path works as before 2021-10-14 08:59:28 +01:00
prelude Move asm! and global_asm! to core::arch 2021-07-18 18:30:58 -04:00
process Test that env_clear works on Windows 2021-06-24 09:32:24 +01:00
sync Add #[must_use] to remaining std functions (O-Z) 2021-10-30 23:37:32 -04:00
sys Rollup merge of #89068 - bjorn3:restructure_rt2, r=joshtriplett 2021-10-31 13:20:04 +01:00
sys_common Add #[must_use] to remaining std functions (O-Z) 2021-10-30 23:37:32 -04:00
thread Rollup merge of #90431 - jkugelman:must-use-std-o-through-z, r=joshtriplett 2021-10-31 13:20:07 +01:00
time Add #[must_use] to remaining std functions (O-Z) 2021-10-30 23:37:32 -04:00
alloc.rs Rename rterr to rtprintpanic 2021-05-19 15:52:09 +02:00
ascii.rs Convert many files to intra-doc links 2020-09-02 17:37:40 -04:00
backtrace.rs Add #[must_use] to remaining std functions (A-N) 2021-10-30 23:44:02 -04:00
env.rs Add #[must_use] to remaining std functions (A-N) 2021-10-30 23:44:02 -04:00
error.rs Stabilize try_reserve 2021-10-04 10:29:46 +01:00
f32.rs Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
f64.rs Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
fs.rs Rollup merge of #90430 - jkugelman:must-use-std-a-through-n, r=joshtriplett 2021-10-31 13:20:06 +01:00
keyword_docs.rs Fix typo in break docs 2021-09-16 14:51:14 +03:00
lazy.rs Add #[must_use] to core and std constructors 2021-10-10 02:44:26 -04:00
lib.rs Auto merge of #90273 - nbdd0121:const, r=fee1-dead 2021-10-27 15:32:42 +00:00
macros.rs bump bootstrap compiler to 1.55 2021-08-01 11:19:24 -04:00
num.rs Add Saturating type (based on Wrapping type) 2021-08-10 19:27:01 +02:00
panic.rs Deduplicate panic_fmt 2021-10-19 15:02:21 +01:00
panicking.rs Add #[must_use] to remaining std functions (O-Z) 2021-10-30 23:37:32 -04:00
path.rs Rollup merge of #90431 - jkugelman:must-use-std-o-through-z, r=joshtriplett 2021-10-31 13:20:07 +01:00
primitive_docs.rs Add primitive documentation to libcore 2021-09-12 02:23:08 +00:00
process.rs Add #[must_use] to remaining std functions (O-Z) 2021-10-30 23:37:32 -04:00
rt.rs Rollup merge of #89068 - bjorn3:restructure_rt2, r=joshtriplett 2021-10-31 13:20:04 +01:00
time.rs Add #[must_use] to remaining std functions (O-Z) 2021-10-30 23:37:32 -04:00