]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_incremental/persist/fs.rs
fix: Make incremental artifact deletion more robust
[rust.git] / src / librustc_incremental / persist / fs.rs
index 7dcd5c94bf2989628f4eb43df94e301f1a1944c4..7f697b5448464ca74bdf7541a736180392eb9556 100644 (file)
@@ -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(())
     }