@@ -181,6 +181,25 @@ fn suggest_message(suggestion: &Option<String>) -> String {
181181 }
182182}
183183
184+ const NIGHTLY_COMPONENT_NOTE : & str =
185+ "note: sometimes not all components are available in any given nightly" ;
186+
187+ /// Returns extended note/help for toolchain-wide nightly failures (includes pinned-nightly guidance).
188+ pub ( crate ) fn nightly_component_unavailable_help_toolchain ( toolchain : & str ) -> String {
189+ format ! (
190+ "\n {NIGHTLY_COMPONENT_NOTE}\n \
191+ help: if you don't need these components, you could try a minimal installation with:\n \
192+ help: rustup toolchain add {toolchain} --profile minimal\n \
193+ help: if you require these components, please install and use the latest successfully built version,\n \
194+ help: which you can find at <https://rust-lang.github.io/rustup-components-history>\n \
195+ help: after determining the correct date, install it with a command such as:\n \
196+ help: rustup toolchain install nightly-2018-12-27\n \
197+ help: then you can use the toolchain with commands such as:\n \
198+ help: cargo +nightly-2018-12-27 build\n ",
199+ toolchain = toolchain
200+ )
201+ }
202+
184203/// Returns a error message indicating that certain [`Component`]s are unavailable.
185204///
186205/// See also [`components_missing_msg`](../dist/dist/fn.components_missing_msg.html)
@@ -203,10 +222,7 @@ fn component_unavailable_msg(cs: &[Component], manifest: &Manifest, toolchain: &
203222 ) ;
204223
205224 if toolchain. starts_with ( "nightly" ) {
206- let _ = write ! (
207- buf,
208- "(sometimes not all components are available in any given nightly)"
209- ) ;
225+ let _ = writeln ! ( buf, "{NIGHTLY_COMPONENT_NOTE}" ) ;
210226 }
211227 }
212228 cs => {
@@ -227,16 +243,13 @@ fn component_unavailable_msg(cs: &[Component], manifest: &Manifest, toolchain: &
227243 . join ( ", " )
228244 } ;
229245
230- let _ = write ! (
246+ let _ = writeln ! (
231247 buf,
232- "some components are unavailable for download for channel '{toolchain}': {cs_str}"
248+ "some components are unavailable for download for channel '{toolchain}': {cs_str}" ,
233249 ) ;
234250
235251 if toolchain. starts_with ( "nightly" ) {
236- let _ = write ! (
237- buf,
238- "(sometimes not all components are available in any given nightly)"
239- ) ;
252+ let _ = writeln ! ( buf, "{NIGHTLY_COMPONENT_NOTE}" ) ;
240253 }
241254 }
242255 }
0 commit comments