Skip to content

Commit 5da9bed

Browse files
committed
print the full destination path when no track duplicates
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
1 parent c227565 commit 5da9bed

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/cargo/ops/cargo_install.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,13 @@ impl<'cfg, 'a> InstallablePackage<'cfg, 'a> {
258258
if !self.force && !duplicates.is_empty() {
259259
let mut msg: Vec<String> = duplicates
260260
.iter()
261-
.map(|(name, _)| format!("binary `{}` already exists in destination", name))
261+
.map(|(name, _)| {
262+
format!(
263+
"binary `{}` already exists in destination `{}`",
264+
name,
265+
dst.join(name).to_string_lossy()
266+
)
267+
})
262268
.collect();
263269
msg.push("Add --force to overwrite".to_string());
264270
bail!("{}", msg.join("\n"));

tests/testsuite/install_upgrade.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ fn no_track() {
694694
.with_stderr(
695695
"\
696696
[UPDATING] `[..]` index
697-
[ERROR] binary `foo[EXE]` already exists in destination
697+
[ERROR] binary `foo[EXE]` already exists in destination `[..]/.cargo/bin/foo`
698698
Add --force to overwrite
699699
",
700700
)

0 commit comments

Comments
 (0)