about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-06-30 10:41:04 -0400
committerInfRandomness <infrandomness@gmail.com>2022-07-03 22:30:31 +0200
commited92d88ff4c71e2ae02511c040f0e2a88e57a262 (patch)
tree8eb98566e2b5b3966494f322ae986c635333a35d
parent45a69cc215c05bfc283564c9898e9c3704de8c80 (diff)
downloadrust-ed92d88ff4c71e2ae02511c040f0e2a88e57a262.tar.gz
rust-ed92d88ff4c71e2ae02511c040f0e2a88e57a262.zip
ignore rustdoc failures for out-of-tree tools
-rw-r--r--src/bootstrap/doc.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs
index eb29a5e9ffc..3cf0f9b9f99 100644
--- a/src/bootstrap/doc.rs
+++ b/src/bootstrap/doc.rs
@@ -729,7 +729,17 @@ macro_rules! tool_doc {
                 cargo.rustdocflag("--show-type-layout");
                 cargo.rustdocflag("--generate-link-to-definition");
                 cargo.rustdocflag("-Zunstable-options");
-                builder.run(&mut cargo.into());
+                if $in_tree == true {
+                    builder.run(&mut cargo.into());
+                } else {
+                    // Allow out-of-tree docs to fail (since the tool might be in a broken state).
+                    if !builder.try_run(&mut cargo.into()) {
+                        builder.info(&format!(
+                            "WARNING: tool {} failed to document; ignoring failure because it is an out-of-tree tool",
+                            stringify!($tool).to_lowercase(),
+                        ));
+                    }
+                }
             }
         }
     }