about summary refs log tree commit diff
diff options
context:
space:
mode:
authorking6cong <king6cong@gmail.com>2017-02-01 11:49:24 +0800
committerking6cong <king6cong@gmail.com>2017-02-03 16:13:58 +0800
commit5e41ec2cccb86db1a9677d2bfb9d2f623755f3de (patch)
tree426311912dfd3a7c11f76fcca4131411774d568d
parent5de2a24b2ebfa42db8eadab911a107b4a67fabdb (diff)
downloadrust-5e41ec2cccb86db1a9677d2bfb9d2f623755f3de.tar.gz
rust-5e41ec2cccb86db1a9677d2bfb9d2f623755f3de.zip
rename other than copy/remove
-rw-r--r--src/librustc_driver/driver.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs
index a04a5b106b8..6fe6541c1d9 100644
--- a/src/librustc_driver/driver.rs
+++ b/src/librustc_driver/driver.rs
@@ -1084,10 +1084,9 @@ pub fn phase_5_run_llvm_passes(sess: &Session,
         // are going to build an executable
         if sess.opts.output_types.contains_key(&OutputType::Exe) {
             let f = outputs.path(OutputType::Object);
-            fs::copy(&f,
+            fs::rename(&f,
                      f.with_file_name(format!("{}.0.o",
                                               f.file_stem().unwrap().to_string_lossy()))).unwrap();
-            fs::remove_file(f).unwrap();
         }
 
         // Remove assembly source, unless --save-temps was specified