@@ -46,14 +46,6 @@ pub(crate) use triple::*;
46
46
47
47
pub static DEFAULT_DIST_SERVER : & str = "https://static.rust-lang.org" ;
48
48
49
- const TOOLSTATE_MSG : & str =
50
- "If you require these components, please install and use the latest successfully built version,\n \
51
- which you can find at <https://rust-lang.github.io/rustup-components-history>.\n \n After determining \
52
- the correct date, install it with a command such as:\n \n \
53
- rustup toolchain install nightly-2018-12-27\n \n \
54
- Then you can use the toolchain with commands such as:\n \n \
55
- cargo +nightly-2018-12-27 build";
56
-
57
49
/// Returns a error message indicating that certain [`Component`]s are missing in a toolchain distribution.
58
50
///
59
51
/// This message is currently used exclusively in toolchain-wide operations,
@@ -63,8 +55,6 @@ const TOOLSTATE_MSG: &str =
63
55
/// This function will panic when the collection of unavailable components `cs` is empty.
64
56
fn components_missing_msg ( cs : & [ Component ] , manifest : & ManifestV2 , toolchain : & str ) -> String {
65
57
let mut buf = vec ! [ ] ;
66
- let suggestion = format ! ( " rustup toolchain add {toolchain} --profile minimal" ) ;
67
- let nightly_tips = "Sometimes not all components are available in any given nightly. " ;
68
58
69
59
match cs {
70
60
[ ] => panic ! ( "`components_missing_msg` should not be called with an empty collection of unavailable components" ) ,
@@ -90,13 +80,27 @@ fn components_missing_msg(cs: &[Component], manifest: &ManifestV2, toolchain: &s
90
80
}
91
81
92
82
if toolchain. starts_with ( "nightly" ) {
93
- let _ = write ! ( buf, "{nightly_tips}" ) ;
94
-
95
83
let _ = write ! (
96
84
buf,
97
- "If you don't need these components, you could try a minimal installation with:\n \n {suggestion}\n \n {TOOLSTATE_MSG}"
85
+ "\
86
+ Sometimes not all components are available in any given nightly.
87
+ If you don't need these components, you could try a minimal installation with:
88
+
89
+ rustup toolchain add {toolchain} --profile minimal
90
+
91
+ If you require these components, please install and use the latest successfully built version,
92
+ which you can find at <https://rust-lang.github.io/rustup-components-history>.
93
+
94
+ After determining the correct date, install it with a command such as:
95
+
96
+ rustup toolchain install nightly-2018-12-27
97
+
98
+ Then you can use the toolchain with commands such as:
99
+
100
+ cargo +nightly-2018-12-27 build"
98
101
) ;
99
102
}
103
+
100
104
String :: from_utf8 ( buf) . unwrap ( )
101
105
}
102
106
0 commit comments