about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJosh Stone <cuviper@gmail.com>2019-03-27 18:15:39 -0700
committerGitHub <noreply@github.com>2019-03-27 18:15:39 -0700
commit6e65ae779f84ae7e103c202d41338180988b4a62 (patch)
treef8a99c09aff12ca9e86c5ec35485c4bcdf82446c
parent1e9e80fd91ef6c5b3b16985682c10bc1ca10e517 (diff)
parenta365287e10c1bbdc2cb5ba33ce71b7a1d56d79f6 (diff)
downloadrust-6e65ae779f84ae7e103c202d41338180988b4a62.tar.gz
rust-6e65ae779f84ae7e103c202d41338180988b4a62.zip
Rollup merge of #59449 - Marwes:issue_57958, r=michaelwoerister
fix: Make incremental artifact deletion more robust

Should fix the intermittent errors reported in #57958

cc #48614
-rw-r--r--src/librustc_incremental/persist/fs.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/librustc_incremental/persist/fs.rs b/src/librustc_incremental/persist/fs.rs
index 7dcd5c94bf2..7f697b54484 100644
--- a/src/librustc_incremental/persist/fs.rs
+++ b/src/librustc_incremental/persist/fs.rs
@@ -886,7 +886,10 @@ fn safe_remove_dir_all(p: &Path) -> io::Result<()> {
 fn safe_remove_file(p: &Path) -> io::Result<()> {
     if p.exists() {
         let canonicalized = p.canonicalize()?;
-        std_fs::remove_file(canonicalized)
+        match std_fs::remove_file(canonicalized) {
+            Err(ref err) if err.kind() == io::ErrorKind::NotFound => Ok(()),
+            result => result,
+        }
     } else {
         Ok(())
     }