Skip to content

Commit 07d950f

Browse files
committed
Auto merge of #44498 - alexcrichton:fix-nightlies, r=alexcrichton
rustbuild: Fix a distribution bug with rustdoc Apparently `File::create` was called when there was an existing hard link or the like, causing an existing file to get accidentally truncated! Closes #44487
2 parents eba374f + eb26d5b commit 07d950f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/bootstrap/dist.rs

+1
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,7 @@ impl Step for PlainSourceTarball {
900900
fn install(src: &Path, dstdir: &Path, perms: u32) {
901901
let dst = dstdir.join(src.file_name().unwrap());
902902
t!(fs::create_dir_all(dstdir));
903+
drop(fs::remove_file(&dst));
903904
{
904905
let mut s = t!(fs::File::open(&src));
905906
let mut d = t!(fs::File::create(&dst));

0 commit comments

Comments
 (0)