Skip to content

Commit a365287

Browse files
committed
fix: Make incremental artifact deletion more robust
Should fix the intermittent errors reported in #57958 cc #48614
1 parent fbd34ef commit a365287

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,10 @@ fn safe_remove_dir_all(p: &Path) -> io::Result<()> {
886886
fn safe_remove_file(p: &Path) -> io::Result<()> {
887887
if p.exists() {
888888
let canonicalized = p.canonicalize()?;
889-
std_fs::remove_file(canonicalized)
889+
match std_fs::remove_file(canonicalized) {
890+
Err(ref err) if err.kind() == io::ErrorKind::NotFound => Ok(()),
891+
result => result,
892+
}
890893
} else {
891894
Ok(())
892895
}

0 commit comments

Comments
 (0)