Skip to content

Commit d4c9fe7

Browse files
committed
Improve visibility&helpfulness of the 'found multiple rlibs' error
1 parent 3120b09 commit d4c9fe7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/compile-test.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ 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-
panic!("Found multiple rlibs for crate `{}`: `{:?}` and `{:?}", dep, old, path);
51+
panic!(
52+
"\n---------------------------------------------------\n\n \
53+
Found multiple rlibs for crate `{}`: `{:?}` and `{:?}`.\n \
54+
Probably, you need to run `cargo clean` before running tests again.\n \
55+
\n---------------------------------------------------\n",
56+
dep, old, path
57+
);
5258
}
5359
break;
5460
}

0 commit comments

Comments
 (0)