Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add detail to multiple rename deps #6603

Merged
merged 1 commit into from
Jan 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 5 additions & 8 deletions src/cargo/core/resolver/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions tests/testsuite/rename_deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down