There is an officially hosted website for latest rustc internal APIs:
But I can't find the same docs on local path where std doc locates. Like in the folder ~/.rustup/toolchains/nightly-2024-10-12-x86_64-unknown-linux-gnu/share/doc/rust/html/
.
The internal API docs are specific to local toolchain. How can we get them?
I find the command rustup doc
is helpful to open the content in that folder, but there isn't an argument for rustc API docs.
$ rustup doc --help
Open the documentation for the current toolchain
Usage: rustup doc [OPTIONS] [topic]
Arguments:
[topic] Topic such as 'core', 'fn', 'usize', 'eprintln!', 'core::arch', 'alloc::format!', 'std::fs', 'std::fs::read_dir', 'std::io::Bytes', 'std::iter::Sum',
'std::io::error::Result' etc...
Options:
--path Only print the path to the documentation
--toolchain <toolchain> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see `rustup help toolchain`
--alloc The Rust core allocation and collections library
--book The Rust Programming Language book
--cargo The Cargo Book
--core The Rust Core Library
--edition-guide The Rust Edition Guide
--nomicon The Dark Arts of Advanced and Unsafe Rust Programming
--proc_macro A support library for macro authors when defining new macros
--reference The Rust Reference
--rust-by-example A collection of runnable examples that illustrate various Rust concepts and standard libraries
--rustc The compiler for the Rust programming language
--rustdoc Documentation generator for Rust projects
--std Standard library API documentation
--test Support code for rustc's built in unit-test and micro-benchmarking framework
--unstable-book The Unstable Book
--embedded-book The Embedded Rust Book
-h, --help Print help
Discussion:
Opens the documentation for the currently active toolchain with
the default browser.
By default, it opens the documentation index. Use the various
flags to open specific pieces of documentation.
I thought rustc-dev
component would include the API docs, which rustup book says:
rustc-dev
— This component contains the compiler as a library. Most users will not need this; it is only needed for development of tools that link to the compiler, such as making modifications to Clippy.