Try moving the binaries (and fall back to copying) if the build
directory is a temporary one (source isn't a local path).
let staging_dir = try!(TempDir::new_in(&dst, "cargo-install"));
for &(bin, src) in binaries.iter() {
let dst = staging_dir.path().join(bin);
+ // Try to move if `target_dir` is transient.
+ if !source_id.is_path() {
+ if fs::rename(src, &dst).is_ok() {
+ continue
+ }
+ }
try!(fs::copy(src, &dst).chain_error(|| {
human(format!("failed to copy `{}` to `{}`", src.display(),
dst.display()))