Skip to content

Commit ac3ccdd

Browse files
committed
Add stand-alone explanation
1 parent 5dfae68 commit ac3ccdd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cargo/ops/cargo_clean.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,10 @@ fn rm_rf(path: &Path, config: &Config, progress: &mut dyn CleaningProgressBar) -
297297
let entry = entry?;
298298
progress.on_clean()?;
299299
if entry.file_type().is_dir() {
300-
// `remove_dir_all` is used here due to https://github.com/rust-lang/cargo/issues/11441
300+
// The contents should have been removed by now, but sometimes a race condition is hit
301+
// where other files have been added by the OS. `paths::remove_dir_all` also falls back
302+
// to `std::fs::remove_dir_all`, which may be more reliable than a simple walk in
303+
// platform-specific edge cases.
301304
paths::remove_dir_all(entry.path())
302305
.with_context(|| "could not remove build directory")?;
303306
} else {

0 commit comments

Comments
 (0)