about summary refs log tree commit diff
diff options
context:
space:
mode:
authorIgor Aleksanov <popzxc@yandex.ru>2021-06-21 06:57:57 +0300
committerIgor Aleksanov <popzxc@yandex.ru>2021-06-21 06:57:57 +0300
commit310a2043066212e4bc702d2a79dc50a1312ac94d (patch)
tree1c2e20c08ce1b6a6dfc76619cad40267d643a321
parentfaa2fa7490423b30362b44034e9336c469556b6b (diff)
downloadrust-310a2043066212e4bc702d2a79dc50a1312ac94d.tar.gz
rust-310a2043066212e4bc702d2a79dc50a1312ac94d.zip
Provide different message for bootstrapped compiler
-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;