about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-10-31 13:20:07 +0100
committerGitHub <noreply@github.com>2021-10-31 13:20:07 +0100
commit455a79acab1b2fe1263100a7889a1f2a52256c8d (patch)
tree8361dcb08d27436f72fff5f61b8bd54c975e7ac7 /compiler/rustc_codegen_llvm/src
parent26f505c433fc38d0b28b7861a7e194202baa5cc9 (diff)
parenta81d4b18ea7ee03733e983974400816684f78ebe (diff)
downloadrust-455a79acab1b2fe1263100a7889a1f2a52256c8d.tar.gz
rust-455a79acab1b2fe1263100a7889a1f2a52256c8d.zip
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`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions