Rustdoc
Rustdoc is Rust's built-in documentation generator. It reads the ///
and //! doc comments in your source and produces browsable HTML — the same
tooling that generates the standard library docs and every crate on
docs.rs.
Rules
- rust_doc — Build HTML documentation for a
rust_library,rust_binary, orrust_proc_macrotarget. Output is a directory tree suitable for hosting on a static site. - rust_doc_test — Compile and run the code samples embedded
in a crate's doc comments as tests, matching Cargo's
cargo test --docbehavior.
Toolchain
- rustdoc_toolchain — Provide the
rustdocthe rules above run. Registered for@rules_rust//rust/rustdoc:toolchain_typenext to everyrust_toolchaintherustmodule extension registers, sorustdocalways matches the compiler. Rules declare the type asrust_common.rustdoc_toolchain_type; the same page documentsfind_rustdoc, which falls back to therust_docof therust_toolchainwhen norustdoc_toolchainis registered.