-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Rollup of 8 pull requests #90426
Closed
Closed
Rollup of 8 pull requests #90426
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: r00ster <[email protected]>
Co-authored-by: Jane Lusby <[email protected]>
The unifying theme for this commit is weak, admittedly. I put together a list of "expensive" functions when I originally proposed this whole effort, but nobody's cared about that criterion. Still, it's a decent way to bite off a not-too-big chunk of work. Given the grab bag nature of this commit, the messages I used vary quite a bit.
Methods that were only blocked on `const_panic` have been stabilized. The remaining methods of `duration_consts_2` are all related to floats, and as such have been placed behind the `duration_consts_float` feature gate.
Closes rust-lang#81383. Signed-off-by: Miguel Ojeda <[email protected]>
…riplett Add paragraph to ControlFlow docs to menion it works with the ? operator (rust-lang#88715) fixes rust-lang#88715 r? `@steveklabnik`
…s, r=joshtriplett Partially stabilize `duration_consts_2` Methods that were only blocked on `const_panic` have been stabilized. The remaining methods of `duration_consts_2` are all related to floats, and as such have been placed behind the `duration_consts_float` feature gate.
…=joshtriplett Stabilize `is_symlink()` for `Metadata` and `Path` I'm not fully sure about `since` version, correct me if I'm wrong Needs update after stabilization: [cargo-test-support](https://github.com/rust-lang/cargo/blob/8063672238a5b6c3a901c0fc17f3164692d0be85/crates/cargo-test-support/src/paths.rs#L202) Linked issue: rust-lang#85748
…joshtriplett Add #[must_use] to Rc::downgrade Missed this in previous PR rust-lang#89796 (comment) Parent issue: rust-lang#89692 r? `@joshtriplett`
…ations, r=joshtriplett Add #[must_use] to expensive computations The unifying theme for this commit is weak, admittedly. I put together a list of "expensive" functions when I originally proposed this whole effort, but nobody's cared about that criterion. Still, it's a decent way to bite off a not-too-big chunk of work. Given the grab bag nature of this commit, the messages I used vary quite a bit. I'm open to wording changes. For some reason clippy flagged four `BTreeSet` methods but didn't say boo about equivalent ones on `HashSet`. I stared at them for a while but I can't figure out the difference so I added the `HashSet` ones in. ```rust // Flagged by clippy. alloc::collections::btree_set::BTreeSet<T> fn difference<'a>(&'a self, other: &'a BTreeSet<T>) -> Difference<'a, T>; alloc::collections::btree_set::BTreeSet<T> fn symmetric_difference<'a>(&'a self, other: &'a BTreeSet<T>) -> SymmetricDifference<'a, T> alloc::collections::btree_set::BTreeSet<T> fn intersection<'a>(&'a self, other: &'a BTreeSet<T>) -> Intersection<'a, T>; alloc::collections::btree_set::BTreeSet<T> fn union<'a>(&'a self, other: &'a BTreeSet<T>) -> Union<'a, T>; // Ignored by clippy, but not by me. std::collections::HashSet<T, S> fn difference<'a>(&'a self, other: &'a HashSet<T, S>) -> Difference<'a, T, S>; std::collections::HashSet<T, S> fn symmetric_difference<'a>(&'a self, other: &'a HashSet<T, S>) -> SymmetricDifference<'a, T, S> std::collections::HashSet<T, S> fn intersection<'a>(&'a self, other: &'a HashSet<T, S>) -> Intersection<'a, T, S>; std::collections::HashSet<T, S> fn union<'a>(&'a self, other: &'a HashSet<T, S>) -> Union<'a, T, S>; ``` Parent issue: rust-lang#89692 r? `@joshtriplett`
…s, r=joshtriplett Add #[must_use] to mem/ptr functions There's a lot of low-level / unsafe stuff here. Are there legit use cases for ignoring any of these return values? * No regressions in `./x.py test --stage 1 library/std src/tools/clippy`. * One regression in `./x.py test --stage 1 src/test/ui`. Fixed. * I am unable to run `./x.py doc` on my machine so I'll need to wait for the CI to verify doctests pass. I eyeballed all the adjacent tests and they all look okay. Parent issue: rust-lang#89692 r? `@joshtriplett`
…lett Add #[must_use] to remaining core functions 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 everything remaining from the `core` crate. Ignored by clippy for reasons unknown: ```rust core::alloc::Layout unsafe fn for_value_raw<T: ?Sized>(t: *const T) -> Self; core::any const fn type_name_of_val<T: ?Sized>(_val: &T) -> &'static str; ``` Ignored by clippy because of `mut`: ```rust str fn split_at_mut(&mut self, mid: usize) -> (&mut str, &mut str); ``` <del> Ignored by clippy presumably because a caller might want `f` called for side effects. That seems like a bad usage of `map` to me. ```rust core::cell::Ref<'b, T> fn map<U: ?Sized, F>(orig: Ref<'b, T>, f: F) -> Ref<'b, T>; core::cell::Ref<'b, T> fn map_split<U: ?Sized, V: ?Sized, F>(orig: Ref<'b, T>, f: F) -> (Ref<'b, U>, Ref<'b, V>); ``` </del> Parent issue: rust-lang#89692 r? `@joshtriplett`
…olnay Stabilize `option_result_unwrap_unchecked` Closes rust-lang#81383. Stabilization report: rust-lang#81383 (comment). `@rustbot` label +A-option-result +T-libs-api
@bors r+ p=8 rollup=never |
📌 Commit bbe133e has been approved by |
bors
added
the
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
label
Oct 31, 2021
The job Click to see the possible cause of the failure (guessed by this bot)
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
rollup
A PR which is a rollup
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Successful merges:
duration_consts_2
#89542 (Partially stabilizeduration_consts_2
)is_symlink()
forMetadata
andPath
#89677 (Stabilizeis_symlink()
forMetadata
andPath
)option_result_unwrap_unchecked
#89951 (Stabilizeoption_result_unwrap_unchecked
)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup