Build Docs Like Users Read Them

DOCS-BUILD-DOCS-LIKE-USERS-READ-THEM

Summary

Review rendered Rust documentation, links, cfg behavior, and examples in the modes users see. Match validation depth to the risk of feature, metadata, or public example changes.

Rule

Build Rust docs the way users will read them.

Why

Rust docs are consumed through rendered Rustdoc, docs.rs feature configuration, intra-doc links, search, and examples. A Markdown diff can look fine while the rendered page has broken links, hidden cfg-gated items, unreadable examples, or warnings that only appear in the real build mode.

Helps

  • Catches rendered-doc failures and makes documentation review match the user-facing artifact.

Limits

A local Markdown or Rustdoc check is enough for small prose-only edits. Use heavier docs.rs-style builds when features, cfg docs, crate metadata, or public examples change.

Agent Instruction

Build Rust docs the way users will read them because rust docs are consumed through rendered Rustdoc,
docs.rs feature configuration, intra-doc links, search, and examples.

Mechanisms

Supported by cargo doc --no-deps, cargo doc --open, cargo test --doc, RUSTDOCFLAGS="-D warnings", docs.rs cfg builds, and rendered-output review.

References