Skip to content

Commit 166c147

Browse files
committed
Provide a better error when x.py install src/doc doesn't work.
1 parent 60ff731 commit 166c147

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/bootstrap/install.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,12 @@ macro_rules! install {
139139

140140
install!((self, builder, _config),
141141
Docs, "src/doc", _config.docs, only_hosts: false, {
142-
// `expect` should be safe, only None when config.docs is false,
143-
// which is guarded in `should_run`
144-
let tarball = builder.ensure(dist::Docs { host: self.target }).expect("missing docs");
145-
install_sh(builder, "docs", self.compiler.stage, Some(self.target), &tarball);
142+
if let Some(tarball) = builder.ensure(dist::Docs { host: self.target }) {
143+
install_sh(builder, "docs", self.compiler.stage, Some(self.target), &tarball);
144+
} else {
145+
panic!("docs are not available to install, \
146+
check that `build.docs` is true in `config.toml`");
147+
}
146148
};
147149
Std, "library/std", true, only_hosts: false, {
148150
for target in &builder.targets {

0 commit comments

Comments
 (0)