@@ -139,11 +139,17 @@ macro_rules! install {
139139
140140install ! ( ( self , builder, _config) ,
141141 Docs , "src/doc" , _config. docs, only_hosts: false , {
142- let tarball = builder. ensure( dist:: Docs { host: self . target } ) . expect( "missing docs" ) ;
143- 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+ }
144148 } ;
145149 Std , "library/std" , true , only_hosts: false , {
146150 for target in & builder. targets {
151+ // `expect` should be safe, only None when host != build, but this
152+ // only runs when host == build
147153 let tarball = builder. ensure( dist:: Std {
148154 compiler: self . compiler,
149155 target: * target
@@ -165,10 +171,15 @@ install!((self, builder, _config),
165171 }
166172 } ;
167173 RustAnalyzer , "rust-analyzer" , Self :: should_build( _config) , only_hosts: true , {
168- let tarball = builder
169- . ensure( dist:: RustAnalyzer { compiler: self . compiler, target: self . target } )
170- . expect( "missing rust-analyzer" ) ;
171- install_sh( builder, "rust-analyzer" , self . compiler. stage, Some ( self . target) , & tarball) ;
174+ if let Some ( tarball) =
175+ builder. ensure( dist:: RustAnalyzer { compiler: self . compiler, target: self . target } )
176+ {
177+ install_sh( builder, "rust-analyzer" , self . compiler. stage, Some ( self . target) , & tarball) ;
178+ } else {
179+ builder. info(
180+ & format!( "skipping Install rust-analyzer stage{} ({})" , self . compiler. stage, self . target) ,
181+ ) ;
182+ }
172183 } ;
173184 Clippy , "clippy" , Self :: should_build( _config) , only_hosts: true , {
174185 let tarball = builder. ensure( dist:: Clippy { compiler: self . compiler, target: self . target } ) ;
@@ -212,6 +223,8 @@ install!((self, builder, _config),
212223 }
213224 } ;
214225 Analysis , "analysis" , Self :: should_build( _config) , only_hosts: false , {
226+ // `expect` should be safe, only None with host != build, but this
227+ // only uses the `build` compiler
215228 let tarball = builder. ensure( dist:: Analysis {
216229 // Find the actual compiler (handling the full bootstrap option) which
217230 // produced the save-analysis data because that data isn't copied
0 commit comments