rust-lang / rust-lang/rust

rustdoc: Invalid intra-doc link

Open
#142,456 1 comment 1 reaction 1 assignee View on GitHub

@lolbinarycat is already working on this.

Since Aug 24, 2025.

A-intra-doc-links C-bug E-needs-mcve T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

I open https://docs.rs/smol/latest/smol/stream/struct.Map.html.
I see a link to StreamExt::map(), which is an auto-intra-link, see the source code:

pin_project! {
    /// Stream for the [`StreamExt::map()`] method.
    #[derive(Clone, Debug)]
    #[must_use = "streams do nothing unless polled"]
    pub struct Map<S, F> {
        #[pin]
        stream: S,
        f: F,
    }
}

rustdoc computes it as a link to …/prelude/trait._.html#method.map, which is incorrect.

As agreed with @GuillaumeGomez, I'm opening this bug to track it 🐛.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.