From 5e41ec2cccb86db1a9677d2bfb9d2f623755f3de Mon Sep 17 00:00:00 2001 From: king6cong Date: Wed, 1 Feb 2017 11:49:24 +0800 Subject: [PATCH] rename other than copy/remove --- src/librustc_driver/driver.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index a04a5b106b8f..6fe6541c1d91 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