Skip to content

rustdoc and linking to stdlib docs #35183

Closed
@eminence

Description

@eminence
  • Observation: Running rustup doc is great and works wonderfully.
  • Observation: The docs hosted on rust-lang.org are Unix only. Windows-only types are no-where to be found.
  • Observation: After running cargo doc and viewing local docs, any links to stdlib types are redirected to the rust-lang.org hosted docs, and so links to Windows-only types are 404 not found

Problem: How to view the correct version of stdlib docs?

For example, reading the docs for AsRawFd you see this:

This is only available on unix platforms and must be imported in order to call the method. Windows platforms have a corresponding AsRawHandle and AsRawSocket set of traits.

But if you try to search for AsRawSocket, there are no results, which is kinda frustrating.

So my first thought was: how to remove the frustration of Unix-only docs on rust-lang.org? I don't have a proposal for this yet.

But my second thought was this: If rustup knows the path to the stdlib docs, could this path be passed to rustdoc, so that rustdoc can use local stdlib docs, instead of rust-lang.org docs? This should be an optional mode, since a very common use case is to use rustdoc to generated docs to be hosted somewhere (like github pages), and in this case, linking to rust-lang.org docs would make more sense.

What do you all think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.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