diff --git a/Cargo.toml b/Cargo.toml index 18e5399ef16..8238380861d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ curl = { version = "0.4.19", features = ['http2'] } curl-sys = "0.4.15" env_logger = "0.6.0" pretty_env_logger = { version = "0.3", optional = true } -failure = "0.1.2" +failure = "0.1.5" filetime = "0.2" flate2 = { version = "1.0.3", features = ['zlib'] } fs2 = "0.4" diff --git a/src/cargo/core/resolver/resolve.rs b/src/cargo/core/resolver/resolve.rs index b3d990830c5..37df5c86060 100644 --- a/src/cargo/core/resolver/resolve.rs +++ b/src/cargo/core/resolver/resolve.rs @@ -240,14 +240,11 @@ unable to verify that `{0}` is the same as when the lockfile was generated }); let name = names.next().unwrap_or_else(|| crate_name.clone()); for n in names { - if n == name { - continue; - } - failure::bail!( - "multiple dependencies listed for the same crate must \ - all have the same name, but the dependency on `{}` \ - is listed as having different names", - to + failure::ensure!( + n == name, + "the crate `{}` depends on crate `{}` multiple times with different names", + from, + to, ); } Ok(name) diff --git a/tests/testsuite/rename_deps.rs b/tests/testsuite/rename_deps.rs index 915a94d6ded..970c2c8a456 100644 --- a/tests/testsuite/rename_deps.rs +++ b/tests/testsuite/rename_deps.rs @@ -186,8 +186,7 @@ fn rename_twice() { [UPDATING] `[..]` index [DOWNLOADING] crates ... [DOWNLOADED] foo v0.1.0 (registry [..]) -error: multiple dependencies listed for the same crate must all have the same \ -name, but the dependency on `foo v0.1.0` is listed as having different names +error: the crate `test v0.1.0 ([CWD])` depends on crate `foo v0.1.0` multiple times with different names ", ) .run();