diff --git a/src/cargo/ops/cargo_install.rs b/src/cargo/ops/cargo_install.rs index ad62de96d52..f90e017db34 100644 --- a/src/cargo/ops/cargo_install.rs +++ b/src/cargo/ops/cargo_install.rs @@ -258,7 +258,13 @@ impl<'cfg, 'a> InstallablePackage<'cfg, 'a> { if !self.force && !duplicates.is_empty() { let mut msg: Vec = 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")); diff --git a/tests/testsuite/install_upgrade.rs b/tests/testsuite/install_upgrade.rs index 296d21c4fed..82e93e3b253 100644 --- a/tests/testsuite/install_upgrade.rs +++ b/tests/testsuite/install_upgrade.rs @@ -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` Add --force to overwrite ", )