-
Notifications
You must be signed in to change notification settings - Fork 13.9k
impl Ord for params and use unstable sort #146987
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
Conversation
r? @nnethercote rustbot has assigned @nnethercote. Use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did you find this? I don't know if it's worth adding the PartialOrd
/Ord
impls.
I was looking at the code in #146980 because clippy triggers on the mutation of the loop variable, and was wondering about the manual Vec/FxHashSet subset (
I added them, because the |
I think the trade-offs are negligible... it's extremely unlikely to affect performance, and I find readability much the same either way. So it's a question of why bother? |
Well, the way it's currently written, the sort is done with custom |
Eh, ok. @bors r+ rollup |
Rollup of 5 pull requests Successful merges: - #146653 (improve diagnostics for empty attributes) - #146987 (impl Ord for params and use unstable sort) - #147101 (Use `Iterator::eq` and (dogfood) `eq_by` in compiler and library ) - #147123 (Fix removed version numbers of `doc_auto_cfg` and `doc_cfg_hide`) - #147149 (add joboet to library review rotation) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #146987 - hkBst:sort-params-1, r=nnethercote impl Ord for params and use unstable sort AFAICT we are only sorting to find duplicates, so unstable sort should work fine, and maybe is a tiny bit faster?
Rollup of 5 pull requests Successful merges: - rust-lang/rust#146653 (improve diagnostics for empty attributes) - rust-lang/rust#146987 (impl Ord for params and use unstable sort) - rust-lang/rust#147101 (Use `Iterator::eq` and (dogfood) `eq_by` in compiler and library ) - rust-lang/rust#147123 (Fix removed version numbers of `doc_auto_cfg` and `doc_cfg_hide`) - rust-lang/rust#147149 (add joboet to library review rotation) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 5 pull requests Successful merges: - rust-lang/rust#146653 (improve diagnostics for empty attributes) - rust-lang/rust#146987 (impl Ord for params and use unstable sort) - rust-lang/rust#147101 (Use `Iterator::eq` and (dogfood) `eq_by` in compiler and library ) - rust-lang/rust#147123 (Fix removed version numbers of `doc_auto_cfg` and `doc_cfg_hide`) - rust-lang/rust#147149 (add joboet to library review rotation) r? `@ghost` `@rustbot` modify labels: rollup
AFAICT we are only sorting to find duplicates, so unstable sort should work fine, and maybe is a tiny bit faster?