Skip to content

Commit ea0e0f4

Browse files
committed
avoid holding the temp_dir for empty metadata file
1 parent 3e30935 commit ea0e0f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_metadata/src/rmeta/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2158,7 +2158,7 @@ impl EncodedMetadata {
21582158
let file = std::fs::File::open(&path)?;
21592159
let file_metadata = file.metadata()?;
21602160
if file_metadata.len() == 0 {
2161-
return Ok(Self { mmap: None, _temp_dir: temp_dir });
2161+
return Ok(Self { mmap: None, _temp_dir: None });
21622162
}
21632163
let mmap = unsafe { Some(Mmap::map(file)?) };
21642164
Ok(Self { mmap, _temp_dir: temp_dir })

0 commit comments

Comments
 (0)