From e065d96b08c8437f496ee68697fe77e1a4db56a8 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 30 Nov 2023 11:54:32 +1100 Subject: [PATCH] Remove unused field from `IncrCompSession`. --- compiler/rustc_incremental/src/persist/fs.rs | 4 ++-- compiler/rustc_session/src/session.rs | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/compiler/rustc_incremental/src/persist/fs.rs b/compiler/rustc_incremental/src/persist/fs.rs index 2d809030e58..dc6b2be81eb 100644 --- a/compiler/rustc_incremental/src/persist/fs.rs +++ b/compiler/rustc_incremental/src/persist/fs.rs @@ -262,7 +262,7 @@ pub(crate) fn prepare_session_directory( directory." ); - sess.init_incr_comp_session(session_dir, directory_lock, false); + sess.init_incr_comp_session(session_dir, directory_lock); return Ok(()); }; @@ -276,7 +276,7 @@ pub(crate) fn prepare_session_directory( sess.emit_warning(errors::HardLinkFailed { path: &session_dir }); } - sess.init_incr_comp_session(session_dir, directory_lock, true); + sess.init_incr_comp_session(session_dir, directory_lock); return Ok(()); } else { debug!("copying failed - trying next directory"); diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index f8fa0e4dc50..35572378de6 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -814,12 +814,7 @@ pub fn get_tools_search_paths(&self, self_contained: bool) -> Vec { if self_contained { vec![p.clone(), p.join("self-contained")] } else { vec![p] } } - pub fn init_incr_comp_session( - &self, - session_dir: PathBuf, - lock_file: flock::Lock, - load_dep_graph: bool, - ) { + pub fn init_incr_comp_session(&self, session_dir: PathBuf, lock_file: flock::Lock) { let mut incr_comp_session = self.incr_comp_session.borrow_mut(); if let IncrCompSession::NotInitialized = *incr_comp_session { @@ -827,8 +822,7 @@ pub fn init_incr_comp_session( panic!("Trying to initialize IncrCompSession `{:?}`", *incr_comp_session) } - *incr_comp_session = - IncrCompSession::Active { session_directory: session_dir, lock_file, load_dep_graph }; + *incr_comp_session = IncrCompSession::Active { session_directory: session_dir, lock_file }; } pub fn finalize_incr_comp_session(&self, new_directory_path: PathBuf) { @@ -1686,7 +1680,7 @@ enum IncrCompSession { NotInitialized, /// This is the state during which the session directory is private and can /// be modified. - Active { session_directory: PathBuf, lock_file: flock::Lock, load_dep_graph: bool }, + 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 },