Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add #[must_use] to remaining std functions (A-N) #90430

Merged
merged 1 commit into from
Oct 31, 2021

Conversation

jkugelman
Copy link
Contributor

@jkugelman jkugelman commented Oct 31, 2021

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.

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 31, 2021
@rust-log-analyzer

This comment has been minimized.

@jkugelman jkugelman force-pushed the must-use-std-a-through-n branch from 47c4e03 to e129d49 Compare October 31, 2021 03:48
@joshtriplett
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Oct 31, 2021

📌 Commit e129d49 has been approved by joshtriplett

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 31, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 31, 2021
…askrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#89068 (Restructure std::rt (part 2))
 - rust-lang#89786 (Add #[must_use] to len and is_empty)
 - rust-lang#90430 (Add #[must_use] to remaining std functions (A-N))
 - rust-lang#90431 (Add #[must_use] to remaining std functions (O-Z))

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 26f505c into rust-lang:master Oct 31, 2021
@rustbot rustbot added this to the 1.58.0 milestone Oct 31, 2021
@jkugelman jkugelman deleted the must-use-std-a-through-n branch October 31, 2021 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants