Code
std::sync::LazyLock
Reproduction Steps
- go to https://doc.rust-lang.org/nightly/std/sync/struct.LazyLock.html
- 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.
Code
std::sync::LazyLockReproduction Steps
Expected Outcome
All of its associated functions are in an "Associated functions"
Actual Output
All associated functions, including
newandforce, are listed under "Methods".Additionally (doc issue, not rustdoc's fault),
LazyLock::forcedescribes 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
selfparameter 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,
LazyLockis just one of the more confusing instances.