Skip to content

[rustdoc] Allow . to be used the same as :: in the search - #164036

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
GuillaumeGomez:search-dot
Nov 8, 2026
Merged

rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
GuillaumeGomez:search-dot

Conversation

@GuillaumeGomez

Copy link
Copy Markdown
Member

Fixes #118912.

Unresolved questions:

  • Should we only allow one dot in each path?
    • But if so, how to handle fields of enum variants?
  • If there is a dot in the path, should we automatically filter for fields/variants/methods?

cc @fmease @lolbinarycat
r? @notriddle

@rustbot

rustbot commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in HTML/CSS/JS.

cc @lolbinarycat

@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. labels Oct 9, 2026
@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 Oct 9, 2026
@notriddle

Copy link
Copy Markdown
Contributor

This should probably filter down to fields and methods. The original issue went out of its way to ask for that:

The main motivation is cutting down the number of search results

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Sounds fair.

@rustbot

rustbot commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main 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
Copy Markdown
Member Author

To allow to filter on multiple things at once (method, tymethod and structfield), I transformed the typeFilter into a bitmask. Alternatives could be a set or an array, but that seems less good. Anyway, when . is used, we now filter on the listed kinds.

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Fixed tsc lints (typo :') )

@notriddle

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@rust-bors

rust-bors Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit babef78 has been approved by notriddle

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-review Status: Awaiting review from the assignee but also interested parties. labels Nov 7, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 8, 2026
Rollup of 8 pull requests

Successful merges:

 - #164720 (Expand E0271 on return type)
 - #165301 (Fix struct-literal suggestion spans in macros)
 - #165573 ([tiny] Tweak incorrect `#[default]` errors)
 - #164036 ([rustdoc] Allow `.` to be used the same as `::` in the search)
 - #165457 (tests: llvm 24 can merge addrspace declarations again)
 - #165462 (Use `emit_ptr_va_arg` for `va_arg` on AVR)
 - #165609 (OIDC artifact pushes)
 - #165620 (change return type of FloatErrorKind::kind)
rust-bors Bot pushed a commit that referenced this pull request Nov 8, 2026
Rollup of 8 pull requests

Successful merges:

 - #164720 (Expand E0271 on return type)
 - #165301 (Fix struct-literal suggestion spans in macros)
 - #165573 ([tiny] Tweak incorrect `#[default]` errors)
 - #164036 ([rustdoc] Allow `.` to be used the same as `::` in the search)
 - #165457 (tests: llvm 24 can merge addrspace declarations again)
 - #165462 (Use `emit_ptr_va_arg` for `va_arg` on AVR)
 - #165609 (OIDC artifact pushes)
 - #165620 (change return type of FloatErrorKind::kind)
@rust-bors
rust-bors Bot merged commit db6d530 into rust-lang:main Nov 8, 2026
14 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 8, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 8, 2026
Rollup merge of #164036 - GuillaumeGomez:search-dot, r=notriddle

[rustdoc] Allow `.` to be used the same as `::` in the search

Fixes #118912.

Unresolved questions:

 * Should we only allow one dot in each path?
   * But if so, how to handle fields of enum variants?
 * If there is a dot in the path, should we automatically filter for fields/variants/methods?

cc @fmease @lolbinarycat
r? @notriddle
@GuillaumeGomez
GuillaumeGomez deleted the search-dot branch November 9, 2026 10:02
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.

rustdoc search: filter by fields on a given type using .

4 participants