Skip to content

Commit 18d4729

Browse files
committed
update bootstrap hacks
1 parent 66aeb26 commit 18d4729

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/bootstrap/src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1668,11 +1668,6 @@ Executed at: {executed_at}"#,
16681668

16691669
if let Err(e) = fs::remove_file(dst) {
16701670
if cfg!(windows) && e.kind() != io::ErrorKind::NotFound {
1671-
// workaround for https://github.com/rust-lang/rust/issues/127126
1672-
// if removing the file fails, attempt to rename it instead.
1673-
let now = t!(SystemTime::now().duration_since(SystemTime::UNIX_EPOCH));
1674-
let _ = fs::rename(dst, format!("{}-{}", dst.display(), now.as_nanos()));
1675-
16761671
#[cfg(windows)]
16771672
{
16781673
eprintln!(
@@ -1727,6 +1722,11 @@ Executed at: {executed_at}"#,
17271722
}
17281723
}
17291724
}
1725+
1726+
// workaround for https://github.com/rust-lang/rust/issues/127126
1727+
// if removing the file fails, attempt to rename it instead.
1728+
let now = t!(SystemTime::now().duration_since(SystemTime::UNIX_EPOCH));
1729+
let _ = fs::rename(dst, format!("{}-{}", dst.display(), now.as_nanos()));
17301730
}
17311731
}
17321732
let metadata = t!(src.symlink_metadata(), format!("src = {}", src.display()));

0 commit comments

Comments
 (0)