Unwanted macro re-exports show up in documentation
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Code
prelude exported macros
Reproduction Steps
- Open this https://doc.rust-lang.org/std/index.html?search=assert link
Alternatively
- Export macros directly from the prelude with
#[doc(no_inline)]pub usesuch as here: https://github.com/rust-lang/rust/blob/425a9c0a0e365c0b8c6cfd00c2ded83a73bed9a0/library/std/src/prelude/v1.rs#L49
Expected Outcome
If #[doc(no_inline)] is used the re-exported item should not show up.
Actual Output
The re-exported item still shows up.
Version
This issue is not related to a specific browser, it happens with stable, nightly and dev rustdoc.
Additional Details
I noticed this issue while working on https://github.com/rust-lang/rust/pull/139493, which exacerbates the problem to all prelude macros. And there is a test that checks that typing "prinltn" into the search only returns 3 items and not 6 like it does with the change. Which suggests to me these re-exports are not desirable.
Before:
After:
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 with the prelude re-export in library/std/src/prelude/v1.rs and reproduce the behavior through the linked rustdoc search for assert. Read the rustdoc handling of #[doc(no_inline)] and the existing search test mentioned in the issue. Done means no-inline macro re-exports no longer appear in documentation search results while the existing test expectations remain correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100