Skip to content

Commit 6f61089

Browse files
committed
Move TOOLSTATE_MSG to dist to serve toolchain-wide operations
1 parent 99dd8c3 commit 6f61089

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

src/dist/dist.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ static TOOLCHAIN_CHANNELS: &[&str] = &[
4242
r"\d{1}\.\d{1,3}(?:\.\d{1,2})?",
4343
];
4444

45+
const TOOLSTATE_MSG: &str =
46+
"If you require these components, please install and use the latest successful build version,\n\
47+
which you can find at <https://rust-lang.github.io/rustup-components-history>.\n\nAfter determining \
48+
the correct date, install it with a command such as:\n\n \
49+
rustup toolchain install nightly-2018-12-27\n\n\
50+
Then you can use the toolchain with commands such as:\n\n \
51+
cargo +nightly-2018-12-27 build";
52+
4553
/// Returns a error message indicating that certain [`Component`]s are missing in a toolchain distribution.
4654
///
4755
/// This message is currently used exclusively in toolchain-wide operations,
@@ -70,7 +78,7 @@ fn components_missing_msg(cs: &[Component], manifest: &ManifestV2, toolchain: &s
7078

7179
_ = write!(
7280
buf,
73-
"If you don't need the component, you could try a minimal installation with:\n\n{suggestion}"
81+
"If you don't need the component, you could try a minimal installation with:\n\n{suggestion}\n\n{TOOLSTATE_MSG}"
7482
);
7583
}
7684
cs => {
@@ -90,7 +98,7 @@ fn components_missing_msg(cs: &[Component], manifest: &ManifestV2, toolchain: &s
9098

9199
_ = write!(
92100
buf,
93-
"If you don't need the components, you could try a minimal installation with:\n\n{suggestion}"
101+
"If you don't need the components, you could try a minimal installation with:\n\n{suggestion}\n\n{TOOLSTATE_MSG}"
94102
);
95103
}
96104
}

tests/suite/cli_v2.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,18 @@ fn add_missing_component_toolchain() {
10651065
r"component 'rust-std' for target '{0}' is unavailable for download for channel 'nightly'
10661066
Sometimes not all components are available in any given nightly. If you don't need the component, you could try a minimal installation with:
10671067
1068-
rustup toolchain add nightly --profile minimal"
1068+
rustup toolchain add nightly --profile minimal
1069+
1070+
If you require these components, please install and use the latest successful build version,
1071+
which you can find at <https://rust-lang.github.io/rustup-components-history>.
1072+
1073+
After determining the correct date, install it with a command such as:
1074+
1075+
rustup toolchain install nightly-2018-12-27
1076+
1077+
Then you can use the toolchain with commands such as:
1078+
1079+
cargo +nightly-2018-12-27 build"
10691080
),
10701081
);
10711082
});

0 commit comments

Comments
 (0)