Skip to content

Commit 310a204

Browse files
committed
Provide different message for bootstrapped compiler
1 parent faa2fa7 commit 310a204

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tests/compile-test.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,23 @@ fn third_party_crates() -> String {
4848
&& name.rsplit('.').next().map(|ext| ext.eq_ignore_ascii_case("rlib")) == Some(true)
4949
{
5050
if let Some(old) = crates.insert(dep, path.clone()) {
51+
// Check which action should be done in order to remove compiled deps.
52+
// If pre-installed version of compiler is used, `cargo clean` will do.
53+
// Otherwise (for bootstrapped compiler), the dependencies directory
54+
// must be removed manually.
55+
let suggested_action = if std::env::var_os("RUSTC_BOOTSTRAP").is_some() {
56+
"remove the stageN-tools directory"
57+
} else {
58+
"run `cargo clean`"
59+
};
60+
5161
panic!(
5262
"\n---------------------------------------------------\n\n \
5363
Found multiple rlibs for crate `{}`: `{:?}` and `{:?}`.\n \
54-
Probably, you need to run `cargo clean` before running tests again.\n \
64+
Probably, you need to {} before running tests again.\n \
5565
\nFor details on that error see https://github.com/rust-lang/rust-clippy/issues/7343 \
5666
\n---------------------------------------------------\n",
57-
dep, old, path
67+
dep, old, path, suggested_action
5868
);
5969
}
6070
break;

0 commit comments

Comments
 (0)