2025-03-14 21:59:59 -06:00
|
|
|
# cargo rustdoc
|
|
|
|
|
|
|
|
|
|
> Build the documentation of Rust packages.
|
|
|
|
|
> Similar to `cargo doc`, but you can pass options to `rustdoc`. See `rustdoc --help` for all available options.
|
2026-06-12 17:51:25 -06:00
|
|
|
> See also: `rustdoc`.
|
2025-03-14 21:59:59 -06:00
|
|
|
> More information: <https://doc.rust-lang.org/cargo/commands/cargo-rustdoc.html>.
|
|
|
|
|
|
|
|
|
|
- Pass options to `rustdoc`:
|
|
|
|
|
|
|
|
|
|
`cargo rustdoc -- {{rustdoc_options}}`
|
|
|
|
|
|
|
|
|
|
- Warn about a documentation lint:
|
|
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
`cargo rustdoc -- {{[-W|--warn]}} rustdoc::{{lint_name}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Ignore a documentation lint:
|
|
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
`cargo rustdoc -- {{[-A|--allow]}} rustdoc::{{lint_name}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Document the package's library:
|
|
|
|
|
|
|
|
|
|
`cargo rustdoc --lib`
|
|
|
|
|
|
|
|
|
|
- Document the specified binary:
|
|
|
|
|
|
|
|
|
|
`cargo rustdoc --bin {{name}}`
|
|
|
|
|
|
|
|
|
|
- Document the specified example:
|
|
|
|
|
|
|
|
|
|
`cargo rustdoc --example {{name}}`
|
|
|
|
|
|
|
|
|
|
- Document the specified integration test:
|
|
|
|
|
|
|
|
|
|
`cargo rustdoc --test {{name}}`
|