@@ -44,14 +44,6 @@ pub static DEFAULT_DIST_SERVER: &str = "https://static.rust-lang.org";
4444// Deprecated
4545pub ( crate ) static DEFAULT_DIST_ROOT : & str = "https://static.rust-lang.org/dist" ;
4646
47- const TOOLSTATE_MSG : & str =
48- "If you require the component(s), please install and use the latest successful build version,\n \
49- which you can find at <https://rust-lang.github.io/rustup-components-history>.\n \n After determining \
50- the correct date, install it with a command such as:\n \n \
51- rustup toolchain install nightly-2018-12-27\n \n \
52- Then you can use the toolchain with commands such as:\n \n \
53- cargo +nightly-2018-12-27 build";
54-
5547/// Returns a error message indicating that certain [`Component`]s are missing in a toolchain distribution.
5648///
5749/// This message is currently used exclusively in toolchain-wide operations,
@@ -61,8 +53,6 @@ const TOOLSTATE_MSG: &str =
6153/// This function will panic when the collection of unavailable components `cs` is empty.
6254fn components_missing_msg ( cs : & [ Component ] , manifest : & ManifestV2 , toolchain : & str ) -> String {
6355 let mut buf = vec ! [ ] ;
64- let suggestion = format ! ( " rustup toolchain add {toolchain} --profile minimal" ) ;
65- let nightly_tips = "Sometimes not all components are available in any given nightly. " ;
6656
6757 match cs {
6858 [ ] => panic ! ( "`components_missing_msg` should not be called with an empty collection of unavailable components" ) ,
@@ -88,13 +78,27 @@ fn components_missing_msg(cs: &[Component], manifest: &ManifestV2, toolchain: &s
8878 }
8979
9080 if toolchain. starts_with ( "nightly" ) {
91- let _ = write ! ( buf, "{nightly_tips}" ) ;
92-
9381 let _ = write ! (
9482 buf,
95- "If you don't need the component(s), you could try a minimal installation with:\n \n {suggestion}\n \n {TOOLSTATE_MSG}"
83+ "\
84+ Sometimes not all components are available in any given nightly.
85+ If you don't need the component(s), you could try a minimal installation with:
86+
87+ rustup toolchain add {toolchain} --profile minimal
88+
89+ If you require the component(s), please install and use the latest successful build version,
90+ which you can find at <https://rust-lang.github.io/rustup-components-history>.
91+
92+ After determining the correct date, install it with a command such as:
93+
94+ rustup toolchain install nightly-2018-12-27
95+
96+ Then you can use the toolchain with commands such as:
97+
98+ cargo +nightly-2018-12-27 build"
9699 ) ;
97- }
100+ }
101+
98102 String :: from_utf8 ( buf) . unwrap ( )
99103}
100104
0 commit comments