-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
base: master
Are you sure you want to change the base?
Rank doc aliases lower than equivalently matched items #145100
Conversation
r? @notriddle rustbot has assigned @notriddle. Use |
Some changes occurred in HTML/CSS/JS. |
'is_alias': true | ||
}, | ||
], | ||
}, |
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.
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
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.
Good point, updated the test.
// sort doc alias items later | ||
a = Number(aaa.item.is_alias); | ||
b = Number(bbb.item.is_alias); | ||
if (a !== b) { | ||
return a - b; | ||
} | ||
|
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.
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.
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.
It was actually problematic because we do the alpha sort before. I moved the check before the alpha check.
95cb0e5
to
a22cb96
Compare
This comment has been minimized.
This comment has been minimized.
a22cb96
to
38b51f8
Compare
This comment has been minimized.
This comment has been minimized.
38b51f8
to
a34bd2b
Compare
@bors delegate=lolbinarycat |
✌️ @lolbinarycat, you can now approve this pull request! If @GuillaumeGomez told you to " |
@bors r+ |
…r, r=lolbinarycat Rank doc aliases lower than equivalently matched items Follow-up of rust-lang#143988. cc `@lolbinarycat`
Follow-up of #143988.
cc @lolbinarycat