Where can I view std rustdoc compiled for different target arch and OS online?

There is a lot of arch and OS specific things in std, and it would be convenient to be able to look them up directly in the web rustdocs. doc.rust-lang.org seems to only have versions compiled for x86-64 Linux. stdrs.dev provides x86_64-unknown-linux-gnu, x86_64-pc-windows-gnu, x86_64-apple-darwin targets, but seems only nightly.

That doesn't seem to be true. For example core::arch::aarch64 has architecture-specific functions for aarch64 (and std re-exports the core definitions). Similarly, std::os::windows has OS-specific functions for windows. Things like that are generally labelled as to what systems they are available on (it's stated near the top on the pages I linked, because the whole module is gated on the feature for the architecture/system).

The internal module std::sys contains unix impl only. What if I want to quickly check some impl details under Windows without going to the repo or local toolchain to view the source code?

1 Like

I normally look through the GitHub tree for sys

But yeah, it is a pain. IIRC there's supposed to be an "internal docs" version? I can find the internal rustc docs, but it doesn't include the library :frowning:

I think it's "arbitrarily" hardcoded as x86_64-unknown-linux-gnu for now:

There's an unofficial version of the std docs including private/internal items.


I tried downloading some compressed files from a rustup registry (explained at the end), and most platform distribution documentations are there.

Specifically here are the std src-doc looks like in my local Windows machine C:\Users\Administrator\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\share\doc\rust\html\std, and the counterpart from the downloaded rust-docs-1.75.0-x86_64-apple-darwin.tar.xz

download rust-docs or other rustup components for most targets

I don't know if the official rustup registry provides the ability of downloading artifacts through browsers. I don't want to do the search, because I've seen https://static.rust-lang.org/ somewhere, but no artifacts are found.

So I'll continue with the tested registry: https://mirrors.tuna.tsinghua.edu.cn/rustup/dist/

  1. channel-rust-stable.toml contains the latest stable toolchain information where you can find the date it was released on
  2. the latest release was on 2023-12-28, so just go to that directory Index of /rustup/dist/2023-12-28/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
  3. then you'll see a long webpage containing many components that will be installed on different platforms via rustup
  4. download one the name of which starts with rust-docs and ends with the interested target, like rust-docs-1.75.0-x86_64-apple-darwin.tar.xz
  5. unzip it, and open rust-docs-1.75.0-x86_64-apple-darwin\rust-docs-1.75.0-x86_64-apple-darwin\rust-docs\share\doc\rust\html\std\index.html

That's the one I was thinking of! Unfortunately it too only has Unix :pensive:

It has windows and osx if you switch in the dropdown on the left.

1 Like