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.
rust_library, rust_binary, or rust_proc_macro target. Output is a directory tree suitable for hosting on a static site.cargo test --doc behavior.