Skip to content

rustdoc sidebar calls all associated functions methods, not just those that support method syntax #154602

@lolbinarycat

Description

@lolbinarycat

Code

std::sync::LazyLock

Reproduction Steps

  1. go to https://doc.rust-lang.org/nightly/std/sync/struct.LazyLock.html
  2. look at the sidebar

Expected Outcome

All of its associated functions are in an "Associated functions"

Actual Output

All associated functions, including new and force, are listed under "Methods".

Additionally (doc issue, not rustdoc's fault), LazyLock::force describes itself as a method in its description, despite not being callable with method syntax.

Version

rustdoc 1.96.0-nightly (a25435b 2026-03-29)

Additional Details

This is confusing as if you try to use any associated function that does not have a self parameter with method syntax, rustc will tell you it is not a method, despite rustdoc telling you it is a method.

This happens for all types, LazyLock is just one of the more confusing instances.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.T-rustdoc-frontendRelevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions