about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/compile-test.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/compile-test.rs b/tests/compile-test.rs
index 8640cfb963d..caa19e39ccd 100644
--- a/tests/compile-test.rs
+++ b/tests/compile-test.rs
@@ -48,13 +48,23 @@ fn third_party_crates() -> String {
                     && name.rsplit('.').next().map(|ext| ext.eq_ignore_ascii_case("rlib")) == Some(true)
                 {
                     if let Some(old) = crates.insert(dep, path.clone()) {
+                        // Check which action should be done in order to remove compiled deps.
+                        // If pre-installed version of compiler is used, `cargo clean` will do.
+                        // Otherwise (for bootstrapped compiler), the dependencies directory
+                        // must be removed manually.
+                        let suggested_action = if std::env::var_os("RUSTC_BOOTSTRAP").is_some() {
+                            "remove the stageN-tools directory"
+                        } else {
+                            "run `cargo clean`"
+                        };
+
                         panic!(
                             "\n---------------------------------------------------\n\n \
                             Found multiple rlibs for crate `{}`: `{:?}` and `{:?}`.\n \
-                            Probably, you need to run `cargo clean` before running tests again.\n \
+                            Probably, you need to {} before running tests again.\n \
                             \nFor details on that error see https://github.com/rust-lang/rust-clippy/issues/7343 \
                             \n---------------------------------------------------\n",
-                            dep, old, path
+                            dep, old, path, suggested_action
                         );
                     }
                     break;