Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit b28b7c9

Browse files
committed
remove non_durable_rename in rustc_interface::util
1 parent 5aac75a commit b28b7c9

File tree

1 file changed

+0
-18
lines changed
  • compiler/rustc_interface/src

1 file changed

+0
-18
lines changed

compiler/rustc_interface/src/util.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -655,24 +655,6 @@ pub fn build_output_filenames(
655655
}
656656
}
657657

658-
#[cfg(not(target_os = "linux"))]
659-
pub fn non_durable_rename(src: &Path, dst: &Path) -> std::io::Result<()> {
660-
std::fs::rename(src, dst)
661-
}
662-
663-
/// This function attempts to bypass the auto_da_alloc heuristic implemented by some filesystems
664-
/// such as btrfs and ext4. When renaming over a file that already exists then they will "helpfully"
665-
/// write back the source file before committing the rename in case a developer forgot some of
666-
/// the fsyncs in the open/write/fsync(file)/rename/fsync(dir) dance for atomic file updates.
667-
///
668-
/// To avoid triggering this heuristic we delete the destination first, if it exists.
669-
/// The cost of an extra syscall is much lower than getting descheduled for the sync IO.
670-
#[cfg(target_os = "linux")]
671-
pub fn non_durable_rename(src: &Path, dst: &Path) -> std::io::Result<()> {
672-
let _ = std::fs::remove_file(dst);
673-
std::fs::rename(src, dst)
674-
}
675-
676658
/// Returns a version string such as "1.46.0 (04488afe3 2020-08-24)"
677659
pub fn version_str() -> Option<&'static str> {
678660
option_env!("CFG_VERSION")

0 commit comments

Comments
 (0)