Skip to content

Wrong intra-doc links to methods on type aliases #149205

Closed

Description

@WojciechMula

Hi, first of all sorry if it's not the correct repository for reporting this kind of error, but I noticed this on docs.rs.

Steps to reproduce:

  1. Go to https://docs.rs/image/latest/image/type.RgbImage.html
  2. Find method get_pixel -- this item links to the trait method with URL fragment https://docs.rs/image/latest/image/struct.ImageBuffer.html#tymethod.get_pixel
  3. However, on the struct ImageMethod page, all methods have HTML anchors starting with method... not tymethod...
  4. As a result, clicking on the method name, moves us only to the trait's documentation, but not this specific method.

Activity

  1. syphar commented on Nov 22, 2025

    @syphar
    Member

    thi,

    this looks like a rustdoc bug? @GuillaumeGomez ?

  2. GuillaumeGomez commented on Nov 22, 2025

    @GuillaumeGomez
    Member

    Yep it is.

    @WojciechMula: can you try with nightly?

  3. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Nov 22, 2025
  4. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    C-bugCategory: This is a bug.
    A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by name
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Nov 22, 2025
  5. GuillaumeGomez commented on Nov 22, 2025

    @GuillaumeGomez
    Member

    Asking because we recently fixed bugs around anchors recently in #148543.

  6. syphar commented on Nov 22, 2025

    @syphar
    Member

    @GuillaumeGomez docs.rs is building with nightly? ;)

    build also looks like it was after your fix?

    https://docs.rs/crate/image/latest/builds

  7. GuillaumeGomez commented on Nov 22, 2025

    @GuillaumeGomez
    Member

    Ah right. So still a bug (or maybe a new one). Checking that in the next days then.

  8. changed the title [-]Wrong links to trait methods[/-] [+]Wrong intra-doc links to methods on type aliases[/+] on Nov 24, 2025
  9. GuillaumeGomez commented on Nov 24, 2025

    @GuillaumeGomez
    Member

    Some more details about this bug: on type aliases, methods (not necessarily from traits) don't link to the correct upstream method. I wonder whether we should link to the upstream type like we currently do or to the current page method (like we do for deref). For now I'll keep the same behaviour and fix the link generation but might be worth discussing it later on.

  10. added 3 commits that reference this issue on Nov 24, 2025
  11. added a commit that references this issue on Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameC-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions