We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b616d7b commit 64a8af9Copy full SHA for 64a8af9
src/bootstrap/lib.rs
@@ -1425,7 +1425,16 @@ impl Build {
1425
if src == dst {
1426
return;
1427
}
1428
- let _ = fs::remove_file(&dst);
+ #[cfg(windows)]
1429
+ {
1430
+ if let Ok(file) = std::sys::fs::File::open(dst, &std::sys::fs::OpenOptions::new()) {
1431
+ let _ = file.posix_delete();
1432
+ }
1433
1434
+ #[cfg(not(windows))]
1435
1436
+ let _ = fs::remove_file(&dst);
1437
1438
let metadata = t!(src.symlink_metadata());
1439
if metadata.file_type().is_symlink() {
1440
let link = t!(fs::read_link(src));
0 commit comments