Skip to content

Commit

Permalink
fix: Make incremental artifact deletion more robust
Browse files Browse the repository at this point in the history
Should fix the intermittent errors reported in #57958

cc #48614
  • Loading branch information
Marwes committed Mar 26, 2019
1 parent fbd34ef commit a365287
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/librustc_incremental/persist/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand Down

0 comments on commit a365287

Please sign in to comment.