From d4c9fe7549f29ca573f5a58ac94eacd662cd1421 Mon Sep 17 00:00:00 2001 From: Igor Aleksanov Date: Sun, 20 Jun 2021 08:25:30 +0300 Subject: [PATCH] Improve visibility&helpfulness of the 'found multiple rlibs' error --- tests/compile-test.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/compile-test.rs b/tests/compile-test.rs index 7d266a36bb66..72905bd948e6 100644 --- a/tests/compile-test.rs +++ b/tests/compile-test.rs @@ -48,7 +48,13 @@ 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()) { - panic!("Found multiple rlibs for crate `{}`: `{:?}` and `{:?}", dep, old, path); + panic!( + "\n---------------------------------------------------\n\n \ + Found multiple rlibs for crate `{}`: `{:?}` and `{:?}`.\n \ + Probably, you need to run `cargo clean` before running tests again.\n \ + \n---------------------------------------------------\n", + dep, old, path + ); } break; }