about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEric Huss <eric@huss.org>2021-07-12 13:29:47 -0700
committerEric Huss <eric@huss.org>2021-07-12 13:29:47 -0700
commit166c147c2727cd6d6ad4d39c40c51273b8a63c96 (patch)
tree3ef94465f2956f601296e2ee29a53cb1f3360aad /src
parent60ff731110815349dbc052c36e9cc50b9f12f32a (diff)
downloadrust-166c147c2727cd6d6ad4d39c40c51273b8a63c96.tar.gz
rust-166c147c2727cd6d6ad4d39c40c51273b8a63c96.zip
Provide a better error when `x.py install src/doc` doesn't work.
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/install.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs
index 2ac9d3dda20..8a1b6df0daf 100644
--- a/src/bootstrap/install.rs
+++ b/src/bootstrap/install.rs
@@ -139,10 +139,12 @@ macro_rules! install {
 
 install!((self, builder, _config),
     Docs, "src/doc", _config.docs, only_hosts: false, {
-        // `expect` should be safe, only None when config.docs is false,
-        // which is guarded in `should_run`
-        let tarball = builder.ensure(dist::Docs { host: self.target }).expect("missing docs");
-        install_sh(builder, "docs", self.compiler.stage, Some(self.target), &tarball);
+        if let Some(tarball) = builder.ensure(dist::Docs { host: self.target }) {
+            install_sh(builder, "docs", self.compiler.stage, Some(self.target), &tarball);
+        } else {
+            panic!("docs are not available to install, \
+                check that `build.docs` is true in `config.toml`");
+        }
     };
     Std, "library/std", true, only_hosts: false, {
         for target in &builder.targets {