Skip to content

rustdoc: fix href of extern crates in search results#154697

Open
lolbinarycat wants to merge 2 commits intorust-lang:mainfrom
lolbinarycat:rustdoc-renamed-crate
Open

rustdoc: fix href of extern crates in search results#154697
lolbinarycat wants to merge 2 commits intorust-lang:mainfrom
lolbinarycat:rustdoc-renamed-crate

Conversation

@lolbinarycat
Copy link
Copy Markdown
Contributor

@lolbinarycat lolbinarycat commented Apr 1, 2026

View all comments

To avoid modifying the search index, I instead overloaded an existing field that is always unused for extern crate items.

fixes #148300

r? @GuillaumeGomez

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 1, 2026

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez

@rustbot rustbot added A-rustdoc-js Area: Rustdoc's JS front-end 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 Apr 1, 2026
{ 'path': 'foo', 'name': 'st', 'href': '../foo/index.html#reexport.st' },
// FIXME: `href` is wrong: <https://github.com/rust-lang/rust/issues/148300>
{ 'path': 'foo', 'name': 'st2', 'href': '../st2/index.html' },
{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add a code comment here to mention what we're testing. Which made me realize that we should maybe have a proper test file for this test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I actually initially wrote a standalone test for this, but ended up removing it once I found this test.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As you prefer. But if we keep it as is, we might want to rename the file and its top code comment.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 1, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 1, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@lolbinarycat lolbinarycat force-pushed the rustdoc-renamed-crate branch from 7d67acf to 7199a0b Compare April 1, 2026 21:35
@lolbinarycat
Copy link
Copy Markdown
Contributor Author

lolbinarycat commented Apr 1, 2026

Alright, go ahead and do the changes you were talking about, I wont touch the PR until then.

EDIT: nevermind, saw your other comment, should be able to figure it out myself

@GuillaumeGomez
Copy link
Copy Markdown
Member

Well, ping me either for final review or for adding the missing piece. ;)

@lolbinarycat
Copy link
Copy Markdown
Contributor Author

I do not believe $CHANNEL works with this test suite, I'm pretty sure that it is a feature of the rustdoc-ui test suite.

I think I can patch tester.js to add similar functionality, tho.

@GuillaumeGomez
Copy link
Copy Markdown
Member

That was what I planned to do. :)

@lolbinarycat
Copy link
Copy Markdown
Contributor Author

Ah, I see.

@lolbinarycat
Copy link
Copy Markdown
Contributor Author

I'll leave it to you then, it should be fairly simple, just forwarding an envar to a js var.

@GuillaumeGomez
Copy link
Copy Markdown
Member

renamed-crate-148300.js is already relying on nightly std path, so I guess it's fine. Let's go. :)

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 2, 2026

📌 Commit 7199a0b has been approved by GuillaumeGomez

It is now in the queue for this repository.

@rust-bors rust-bors bot 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 2, 2026
@GuillaumeGomez
Copy link
Copy Markdown
Member

Just realized that this is the file added in this PR. Morning...

@bors r-

@rust-bors rust-bors bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 2, 2026
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the rustdoc-renamed-crate branch from 7b8e328 to b24c978 Compare April 2, 2026 14:13
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the rustdoc-renamed-crate branch from b24c978 to 8c44809 Compare April 2, 2026 14:23
@GuillaumeGomez
Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 2, 2026

📌 Commit 8c44809 has been approved by GuillaumeGomez

It is now in the queue for this repository.

@rust-bors rust-bors bot 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 2, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 2, 2026
…, r=GuillaumeGomez

rustdoc: fix href of extern crates in search results

To avoid modifying the search index, I instead overloaded an existing field that is always unused for extern crate items.

fixes rust-lang#148300

r? @GuillaumeGomez
rust-bors bot pushed a commit that referenced this pull request Apr 2, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - #154444 (rustdoc ICE fix: When collecting `Deref` impls with their targets, skip the negative ones)
 - #154590 (Make #[cfg] suggest any or all on #[cfg(a, b)])
 - #154691 (core: Update the feature gate on `TryFrom<integer> for bool`)
 - #154697 (rustdoc: fix href of extern crates in search results)

Failed merges:

 - #154722 (fix(lints): Improve `ill_formed_attribute_input` with better help message)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rustdoc-js Area: Rustdoc's JS front-end A-rustdoc-search Area: Rustdoc's search feature 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.

Renamed extern crates generated wrong href in search results

4 participants