rustdoc: support searching cfg predicates
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Currently, searching macros on https://docs.rs/tokio/1.33.0/tokio/ has 0 hits. It would be nice if it pulled up https://docs.rs/tokio/1.33.0/tokio/attr.main.html, which uses doc(cfg) to tell rustdoc that it's only available when the macros feature is enabled.
Note that this will make the search parser a little more complicated, since features don't have to be valid rust identifiers (in particular, it currently chokes on test-util):
@rustbot label F-doc_cfg
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the macros search on the linked Tokio docs.rs page and inspect rustdoc's search parser, especially how it handles doc(cfg) predicates. Done means searches find items gated by predicates such as macros and test-util, including feature names that contain hyphens.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation, search
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100