Skip to content

Commit

Permalink
Auto merge of #9850 - hi-rustin:rustin-patch-no-track, r=alexcrichton
Browse files Browse the repository at this point in the history
print the full destination path when no track duplicates

close #9797
  • Loading branch information
bors committed Sep 1, 2021
2 parents ac58670 + 774ccc3 commit 18751dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/cargo/ops/cargo_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,13 @@ impl<'cfg, 'a> InstallablePackage<'cfg, 'a> {
if !self.force && !duplicates.is_empty() {
let mut msg: Vec<String> = duplicates
.iter()
.map(|(name, _)| format!("binary `{}` already exists in destination", name))
.map(|(name, _)| {
format!(
"binary `{}` already exists in destination `{}`",
name,
dst.join(name).to_string_lossy()
)
})
.collect();
msg.push("Add --force to overwrite".to_string());
bail!("{}", msg.join("\n"));
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/install_upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ fn no_track() {
.with_stderr(
"\
[UPDATING] `[..]` index
[ERROR] binary `foo[EXE]` already exists in destination
[ERROR] binary `foo[EXE]` already exists in destination `[..]/.cargo/bin/foo[EXE]`
Add --force to overwrite
",
)
Expand Down

0 comments on commit 18751dd

Please sign in to comment.