Skip to content

Commit 556f9ac

Browse files
committed
Allowing for the missing of a directory during cleanup to not be a hard error
1 parent 34700c1 commit 556f9ac

File tree

1 file changed

+4
-1
lines changed
  • src/librustc_incremental/persist

1 file changed

+4
-1
lines changed

src/librustc_incremental/persist/fs.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,10 @@ fn all_except_most_recent(
927927
fn safe_remove_dir_all(p: &Path) -> io::Result<()> {
928928
if p.exists() {
929929
let canonicalized = p.canonicalize()?;
930-
std_fs::remove_dir_all(canonicalized)
930+
match std_fs::remove_dir_all(canonicalized) {
931+
Err(ref err) if err.kind() == io::ErrorKind::NotFound => Ok(()),
932+
result => result,
933+
}
931934
} else {
932935
Ok(())
933936
}

0 commit comments

Comments
 (0)