Skip to content

Commit eb26d5b

Browse files
committed
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
1 parent 19d30fc commit eb26d5b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/bootstrap/dist.rs

Lines changed: 1 addition & 0 deletions
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)