Skip to content

Commit ec64b4c

Browse files
committed
add a comment about the drop order for EncodedMetadata
1 parent 03de5c4 commit ec64b4c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/rustc_metadata/src/rmeta/encoder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,6 +2144,7 @@ fn prefetch_mir(tcx: TyCtxt<'_>) {
21442144
// generated regardless of trailing bytes that end up in it.
21452145

21462146
pub struct EncodedMetadata {
2147+
// The declaration order matters because `mmap` should be dropped before `_temp_dir`.
21472148
mmap: Option<Mmap>,
21482149
// We need to carry MaybeTempDir to avoid deleting the temporary
21492150
// directory while accessing the Mmap.

0 commit comments

Comments
 (0)