From a8045033d2fe2d62e1e2babe21347f8129f7593f Mon Sep 17 00:00:00 2001 From: Kevin Reid Date: Wed, 24 Jul 2024 16:52:38 -0700 Subject: [PATCH] xtask: Make broken doc links or other doc lint into errors. --- tools/xtask/src/xtask.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/xtask/src/xtask.rs b/tools/xtask/src/xtask.rs index 7962ec9ce..7f445ee77 100644 --- a/tools/xtask/src/xtask.rs +++ b/tools/xtask/src/xtask.rs @@ -75,7 +75,10 @@ enum XtaskCommand { no_run: bool, }, - /// Compile and report warnings without testing. + /// Check for lint and generate documentation, but do not test. + /// + /// Caution: If there are rustc or clippy warnings only, the exit code is still zero. + /// Lint, /// Format code (as `cargo fmt` but covering all packages) @@ -201,7 +204,7 @@ fn main() -> Result<(), ActionError> { // libraries with docs elsewhere. if config.scope.includes_main_workspace() { let _t = CaptureTime::new(&mut time_log, "doc"); - cargo().arg("doc").run()?; + cargo().env("RUSTDOCFLAGS", "-Dwarnings").arg("doc").run()?; } } XtaskCommand::Fmt => {