Skip to content

Conversation

@GuillaumeGomez
Copy link
Member

We currently have a list of type filters, some constants to be able to index the list of type filters and finally a switch to include some types in a given filter (for example when we filter on constant, we also include associatedconstant items).

r? @notriddle

@rustbot
Copy link
Collaborator

rustbot commented Nov 3, 2025

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @jsha, @lolbinarycat

@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. labels Nov 3, 2025
@rustbot rustbot added 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 Nov 3, 2025
}
const index = itemTypes.findIndex(i => i === typename);
if (index < 0) {
// @ts-ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// @ts-ignore
// @ts-expected-error

It would also be nice if you said why the type error is ignored whenever you introduce a new one.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you made a typo: It's ts-expect-error

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh right, the tsc error is:

src/librustdoc/html/static/js/search.js:1209:19 - error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Readonly<{ keyword: 0; primitive: 1; mod: 2; externcrate: 3; import: 4; struct: 5; enum: 6; fn: 7; type: 8; static: 9; trait: 10; impl: 11; tymethod: 12; method: 13; structfield: 14; variant: 15; macro: 16; associatedtype: 17; ... 9 more ...; attribute: 27; }>'.
  No index signature with a parameter of type 'string' was found on type 'Readonly<{ keyword: 0; primitive: 1; mod: 2; externcrate: 3; import: 4; struct: 5; enum: 6; fn: 7; type: 8; static: 9; trait: 10; impl: 11; tymethod: 12; method: 13; structfield: 14; variant: 15; macro: 16; associatedtype: 17; ... 9 more ...; attribute: 27; }>'.


// No match
return false;
// @ts-ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// @ts-ignore
// @ts-expected-error

@notriddle
Copy link
Contributor

r=me after fixing those two problems

@rustbot
Copy link
Collaborator

rustbot commented Nov 5, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@GuillaumeGomez
Copy link
Member Author

@bors r=notriddle rollup

@bors
Copy link
Collaborator

bors commented Nov 5, 2025

📌 Commit 72d94d1 has been approved by notriddle

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 Nov 5, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 5, 2025
…, r=notriddle

[rustdoc search] Simplify itemTypes and filter "dependencies"

We currently have a list of type filters, some constants to be able to index the list of type filters and finally a `switch` to include some types in a given filter (for example when we filter on `constant`, we also include `associatedconstant` items).

r? `@notriddle`
bors added a commit that referenced this pull request Nov 5, 2025
Rollup of 8 pull requests

Successful merges:

 - #147994 (Deduplicate deprecation warning when using unit or tuple structs)
 - #148440 ([rustdoc search] Simplify itemTypes and filter "dependencies")
 - #148501 (triagebot: Create Zulip topics for libs backports)
 - #148517 (Remove no longer necessary lint allow)
 - #148518 (Unify the configuration of the compiler docs)
 - #148523 (miri subtree update)
 - #148525 (Fix ICE from lit_to_mir_constant caused by type error)
 - #148534 (Merge `Vec::push{,_mut}_within_capacity`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 54fa498 into rust-lang:master Nov 6, 2025
11 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Nov 6, 2025
rust-timer added a commit that referenced this pull request Nov 6, 2025
Rollup merge of #148440 - GuillaumeGomez:improve-search-code, r=notriddle

[rustdoc search] Simplify itemTypes and filter "dependencies"

We currently have a list of type filters, some constants to be able to index the list of type filters and finally a `switch` to include some types in a given filter (for example when we filter on `constant`, we also include `associatedconstant` items).

r? ``@notriddle``
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Nov 6, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#147994 (Deduplicate deprecation warning when using unit or tuple structs)
 - rust-lang/rust#148440 ([rustdoc search] Simplify itemTypes and filter "dependencies")
 - rust-lang/rust#148501 (triagebot: Create Zulip topics for libs backports)
 - rust-lang/rust#148517 (Remove no longer necessary lint allow)
 - rust-lang/rust#148518 (Unify the configuration of the compiler docs)
 - rust-lang/rust#148523 (miri subtree update)
 - rust-lang/rust#148525 (Fix ICE from lit_to_mir_constant caused by type error)
 - rust-lang/rust#148534 (Merge `Vec::push{,_mut}_within_capacity`)

r? `@ghost`
`@rustbot` modify labels: rollup
@GuillaumeGomez GuillaumeGomez deleted the improve-search-code branch November 6, 2025 10:29
makai410 pushed a commit to makai410/rustc_public that referenced this pull request Nov 7, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#147994 (Deduplicate deprecation warning when using unit or tuple structs)
 - rust-lang/rust#148440 ([rustdoc search] Simplify itemTypes and filter "dependencies")
 - rust-lang/rust#148501 (triagebot: Create Zulip topics for libs backports)
 - rust-lang/rust#148517 (Remove no longer necessary lint allow)
 - rust-lang/rust#148518 (Unify the configuration of the compiler docs)
 - rust-lang/rust#148523 (miri subtree update)
 - rust-lang/rust#148525 (Fix ICE from lit_to_mir_constant caused by type error)
 - rust-lang/rust#148534 (Merge `Vec::push{,_mut}_within_capacity`)

r? `@ghost`
`@rustbot` modify labels: rollup
makai410 pushed a commit to makai410/rust that referenced this pull request Nov 8, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#147994 (Deduplicate deprecation warning when using unit or tuple structs)
 - rust-lang#148440 ([rustdoc search] Simplify itemTypes and filter "dependencies")
 - rust-lang#148501 (triagebot: Create Zulip topics for libs backports)
 - rust-lang#148517 (Remove no longer necessary lint allow)
 - rust-lang#148518 (Unify the configuration of the compiler docs)
 - rust-lang#148523 (miri subtree update)
 - rust-lang#148525 (Fix ICE from lit_to_mir_constant caused by type error)
 - rust-lang#148534 (Merge `Vec::push{,_mut}_within_capacity`)

r? `@ghost`
`@rustbot` modify labels: rollup
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 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.

5 participants