From b998cff5582b819910cc8e0f092c15151b930d02 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Tue, 2 Jul 2024 06:04:23 +0000 Subject: [PATCH] Use `cfg!(windows)` --- src/bootstrap/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index 6d00ff9982d96..f5941e31e251f 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -1678,7 +1678,7 @@ impl Build { return; } if let Err(e) = fs::remove_file(dst) { - if e.kind() != io::ErrorKind::NotFound { + if cfg!(windows) && e.kind() != io::ErrorKind::NotFound { // workaround for https://github.com/rust-lang/rust/issues/127126 // if removing the file fails, attempt to rename it instead. let now = t!(SystemTime::now().duration_since(SystemTime::UNIX_EPOCH));