Skip to main content

doc

Function doc 

Source
pub(crate) fn doc(args: &[String]) -> Result<()>
Expand description

cargo xtask doc — generate rustdoc API reference for workspace crates.

Defaults match the repo’s documented doc-build posture: public items only, no dependency docs, all features so the full gated surface renders. The --strict flag enforces RUSTDOCFLAGS=-D warnings (what CI and cargo xtask ci use); without it warnings are surfaced but non-fatal so a stray doc-link doesn’t block a local cargo xtask doc --open.

--docsrs-cfg appends --cfg docsrs to RUSTDOCFLAGS so the #![cfg_attr(docsrs, feature(doc_auto_cfg))] attributes in feature-gated crates activate and rustdoc renders per-item feature-requirement badges. doc_auto_cfg is a nightly rustdoc feature, so this flag needs a nightly toolchain (e.g. RUSTUP_TOOLCHAIN=nightly cargo xtask doc --docsrs-cfg); the stable CI doc gate never passes it and is unaffected.

After a successful build the doc root also gets a landing index.html (workspace crate listing) plus openapi.html/openapi.json (Redoc) — see doc_site::emit.