Skip to content

Rank doc aliases lower than equivalently matched items #145100

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GuillaumeGomez
Copy link
Member

Follow-up of #143988.

cc @lolbinarycat

@rustbot
Copy link
Collaborator

rustbot commented Aug 8, 2025

r? @notriddle

rustbot has assigned @notriddle.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-rustdoc-search Area: Rustdoc's search feature S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Aug 8, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 8, 2025

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @jsha, @lolbinarycat

'is_alias': true
},
],
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is ineffective, as Bar would lexicographically sort before foo anyways. This could be fixed just by swapping the names, so the struct is Foo and the function is bar.

I ran the test against current master and it passed, which is generally never what you want for tests introduced alongside what they are testing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, updated the test.

Comment on lines 3377 to 3383
// sort doc alias items later
a = Number(aaa.item.is_alias);
b = Number(bbb.item.is_alias);
if (a !== b) {
return a - b;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't think of any realistic example where this having such low priority would actually cause issues, and any iffy examples would be better addressed by modifying the edit distance algorithm to lower the cost of insertions at the start and end.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was actually problematic because we do the alpha sort before. I moved the check before the alpha check.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
Copy link
Member Author

@bors delegate=lolbinarycat

@bors
Copy link
Collaborator

bors commented Aug 8, 2025

✌️ @lolbinarycat, you can now approve this pull request!

If @GuillaumeGomez told you to "r=me" after making some further change, please make that change, then do @bors r=@GuillaumeGomez

@lolbinarycat lolbinarycat added the relnotes Marks issues that should be documented in the release notes of the next release. label Aug 9, 2025
@lolbinarycat
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 9, 2025

📌 Commit a34bd2b has been approved by lolbinarycat

It is now in the queue for this repository.

@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 Aug 9, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 9, 2025
…r, r=lolbinarycat

Rank doc aliases lower than equivalently matched items

Follow-up of rust-lang#143988.

cc `@lolbinarycat`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-search Area: Rustdoc's search feature relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants