Skip to content

Commit

Permalink
Clarify the lockfile field in IncrCompSession.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Nov 30, 2023
1 parent e065d96 commit 275b793
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions compiler/rustc_session/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,8 @@ impl Session {
panic!("Trying to initialize IncrCompSession `{:?}`", *incr_comp_session)
}

*incr_comp_session = IncrCompSession::Active { session_directory: session_dir, lock_file };
*incr_comp_session =
IncrCompSession::Active { session_directory: session_dir, _lock_file: lock_file };
}

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

0 comments on commit 275b793

Please sign in to comment.