about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Denton <chris@chrisdenton.dev>2024-07-02 06:04:23 +0000
committerChris Denton <chris@chrisdenton.dev>2024-07-02 06:04:23 +0000
commitb998cff5582b819910cc8e0f092c15151b930d02 (patch)
tree2931f609eefd647a3b0d88b906f2bf91ab2541b9
parent3d6cc605356f0919ae0bd024aba6cec5a9981ea7 (diff)
downloadrust-b998cff5582b819910cc8e0f092c15151b930d02.tar.gz
rust-b998cff5582b819910cc8e0f092c15151b930d02.zip
Use `cfg!(windows)`
-rw-r--r--src/bootstrap/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
index 6d00ff9982d..f5941e31e25 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));