@@ -44,14 +44,6 @@ pub static DEFAULT_DIST_SERVER: &str = "https://static.rust-lang.org";
44
44
// Deprecated
45
45
pub ( crate ) static DEFAULT_DIST_ROOT : & str = "https://static.rust-lang.org/dist" ;
46
46
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
-
55
47
/// Returns a error message indicating that certain [`Component`]s are missing in a toolchain distribution.
56
48
///
57
49
/// This message is currently used exclusively in toolchain-wide operations,
@@ -61,8 +53,6 @@ const TOOLSTATE_MSG: &str =
61
53
/// This function will panic when the collection of unavailable components `cs` is empty.
62
54
fn components_missing_msg ( cs : & [ Component ] , manifest : & ManifestV2 , toolchain : & str ) -> String {
63
55
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. " ;
66
56
67
57
match cs {
68
58
[ ] => 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
88
78
}
89
79
90
80
if toolchain. starts_with ( "nightly" ) {
91
- let _ = write ! ( buf, "{nightly_tips}" ) ;
92
-
93
81
let _ = write ! (
94
82
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"
96
99
) ;
97
- }
100
+ }
101
+
98
102
String :: from_utf8 ( buf) . unwrap ( )
99
103
}
100
104
0 commit comments