Skip to content

Commit 275b793

Browse files
committed
Clarify the lockfile field in IncrCompSession.
1 parent e065d96 commit 275b793

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

compiler/rustc_session/src/session.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,8 @@ impl Session {
822822
panic!("Trying to initialize IncrCompSession `{:?}`", *incr_comp_session)
823823
}
824824

825-
*incr_comp_session = IncrCompSession::Active { session_directory: session_dir, lock_file };
825+
*incr_comp_session =
826+
IncrCompSession::Active { session_directory: session_dir, _lock_file: lock_file };
826827
}
827828

828829
pub fn finalize_incr_comp_session(&self, new_directory_path: PathBuf) {
@@ -1679,8 +1680,10 @@ enum IncrCompSession {
16791680
/// needed.
16801681
NotInitialized,
16811682
/// This is the state during which the session directory is private and can
1682-
/// be modified.
1683-
Active { session_directory: PathBuf, lock_file: flock::Lock },
1683+
/// be modified. `_lock_file` is never directly used, but its presence
1684+
/// alone has an effect, because the file will unlock when the session is
1685+
/// dropped.
1686+
Active { session_directory: PathBuf, _lock_file: flock::Lock },
16841687
/// This is the state after the session directory has been finalized. In this
16851688
/// state, the contents of the directory must not be modified any more.
16861689
Finalized { session_directory: PathBuf },

0 commit comments

Comments
 (0)