Uh oh!
There was an error while loading. Please reload this page.
More Clippy fixes for alloc, core and std - #64178
Conversation
rust-highfive
commented
Sep 5, 2019
r? @TimNN (rust_highfive has picked a reviewer for you, use r? to override) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
For comparison to the previous comment, this one seems fine, since it can move self and doesn't add extra &muts. (Though it should arguably be rewritten as a try_fold...)
There was a problem hiding this comment.
Thank you for explanation.
I cannot figure out how to change it to try_fold so should I keep it or revert?
There was a problem hiding this comment.
IIRC generated assembly was exactly the same but I'll drop it anyway.
Should I add FIXME about rewriting it with try_fold?
Uh oh!
There was an error while loading. Please reload this page.
|
Alexendoo
commented
Oct 2, 2019
Ping from triage, any updates? @TimNN |
TimNN
commented
Oct 5, 2019
Sorry, I don't have the time right now to review Rust PRs, so r? @scottmcm since they already commented on this PR. |
JohnCSimon
commented
Oct 12, 2019
Ping from triage |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
I think this should not be done in this PR. Using ? may have performance implications compared to the old code (as well as creating the reference -- which seems odd).
There was a problem hiding this comment.
I honestly have no idea about this as_ref(), possibly it was added by IDE when I was applying lints.
? has been used 14 times in this whole file although it performs a bit worse: https://godbolt.org/z/nHS4fh
I'll drop it but what about other 14 uses in this file, should they be left as is or replaced?
There was a problem hiding this comment.
I don't think we should add this to libstd, at least for now; I'm not sure libs team wants these scattered around.
There was a problem hiding this comment.
Sure I'll remove all Clippy annotations.
One day if Clippy is expected to be over Rust codebase this will be probably unavoidable though. Probably topic for a meeting.
There was a problem hiding this comment.
Also dropped mati865@694e625
Should I bring annotations topic to the libs teams somehow?
Mark-Simulacrum
left a comment
There was a problem hiding this comment.
A lot of these are fine but left a few comments.
Uh oh!
There was an error while loading. Please reload this page.
scottmcm
left a comment
There was a problem hiding this comment.
This looks pretty good, I have just two requests before r=me
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Updated the code and the list of (my) open questions: #64178 (comment) @rustbot modify labels: -S-waiting-on-author +S-waiting-on-review |
bors
commented
Oct 22, 2019
☔ The latest upstream changes (presumably #65503) made this pull request unmergeable. Please resolve the merge conflicts. |
scottmcm
commented
Oct 23, 2019
bors
commented
Oct 23, 2019
📌 Commit bedbf3b has been approved by |
More Clippy fixes for alloc, core and std Continuation of rust-lang#63805
Rollup of 12 pull requests Successful merges: - #64178 (More Clippy fixes for alloc, core and std) - #65144 (Add Cow::is_borrowed and Cow::is_owned) - #65193 (Lockless LintStore) - #65479 (Add the `matches!( $expr, $pat ) -> bool` macro) - #65518 (Avoid ICE when checking `Destination` of `break` inside a closure) - #65583 (rustc_metadata: use a table for super_predicates, fn_sig, impl_trait_ref.) - #65641 (Derive `Rustc{En,De}codable` for `TokenStream`.) - #65648 (Eliminate `intersect_opt`.) - #65657 (Remove `InternedString`) - #65691 (Update E0659 error code long explanation to 2018 edition) - #65696 (Fix an issue with const inference variables sticking around under Chalk + NLL) - #65704 (relax ExactSizeIterator bound on write_bytes) Failed merges: r? @ghost
Continuation of #63805