-
Notifications
You must be signed in to change notification settings - Fork 14k
[rustdoc search] Simplify itemTypes and filter "dependencies" #148440
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
Conversation
|
Some changes occurred in HTML/CSS/JS. |
| } | ||
| const index = itemTypes.findIndex(i => i === typename); | ||
| if (index < 0) { | ||
| // @ts-ignore |
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.
| // @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.
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 think you made a typo: It's ts-expect-error
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.
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 |
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.
| // @ts-ignore | |
| // @ts-expected-error |
|
r=me after fixing those two problems |
c11d24b to
72d94d1
Compare
|
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. |
|
@bors r=notriddle rollup |
…, 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`
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
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``
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
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
…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
We currently have a list of type filters, some constants to be able to index the list of type filters and finally a
switchto include some types in a given filter (for example when we filter onconstant, we also includeassociatedconstantitems).r? @notriddle