Fix Ord violations in rustdoc items sorting - #128139
Closed
GuillaumeGomez wants to merge 1 commit into
Closed
Conversation
Collaborator
|
Failed to set assignee to
|
Member
Author
|
Ah, they're not part of a Rust team. In this case: r? @notriddle |
This comment has been minimized.
This comment has been minimized.
GuillaumeGomez
force-pushed
the
fix-ord-violation
branch
from
July 24, 2024 16:42
04665f3 to
e3fdafc
Compare
notriddle
reviewed
Jul 24, 2024
notriddle
reviewed
Jul 24, 2024
| match ln.cmp(&rn) { | ||
| Ordering::Equal => (), | ||
| match (lb.parse::<u64>(), rb.parse::<u64>()) { | ||
| (Err(_), Err(_)) => return Ordering::Equal, |
Contributor
There was a problem hiding this comment.
I don't like this result, either.
Let's just use the same function the style-guide recommends for rustfmt, unless there's a compelling reason not to.
Member
Author
|
Closing in favor of #128146. |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 24, 2024
…GuillaumeGomez rustdoc: clean up and fix ord violations in item sorting Based on rust-lang#128139 with a few minor changes: - The name sorting function is changed to follow the [version sort] from the style guide - the `cmp` function is redesigned to more obviously make a partial order, by always return `cmp()` of the same variable as the `!=` above [version sort]: https://doc.rust-lang.org/nightly/style-guide/index.html#sorting
github-actions Bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Jul 25, 2024
…Gomez rustdoc: clean up and fix ord violations in item sorting Based on rust-lang/rust#128139 with a few minor changes: - The name sorting function is changed to follow the [version sort] from the style guide - the `cmp` function is redesigned to more obviously make a partial order, by always return `cmp()` of the same variable as the `!=` above [version sort]: https://doc.rust-lang.org/nightly/style-guide/index.html#sorting
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Needed for #128083.
Nice explanations of the ord violations can be found here.
r? @orlp