diff --git a/src/runtime.rs b/src/runtime.rs index d0821ca8..36213b9b 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -149,22 +149,6 @@ impl Runtime { self.empty_dependencies.clone() } - /// Executes `op` but ignores its effect on - /// the query dependencies; intended for use - /// by `DebugWithDb` only. - /// - /// # Danger: intended for debugging only - /// - /// This operation is intended for **debugging only**. - /// Misuse will cause Salsa to give incorrect results. - /// The expectation is that the type `R` produced will be - /// logged or printed out. **The type `R` that is produced - /// should not affect the result or other outputs - /// (such as accumulators) from the current Salsa query.** - pub fn debug_probe(&self, op: impl FnOnce() -> R) -> R { - self.local_state.debug_probe(op) - } - pub(crate) fn report_tracked_read( &self, key_index: DependencyIndex, diff --git a/src/runtime/active_query.rs b/src/runtime/active_query.rs index 4e966ca9..35db2539 100644 --- a/src/runtime/active_query.rs +++ b/src/runtime/active_query.rs @@ -40,26 +40,6 @@ pub(super) struct ActiveQuery { pub(super) disambiguator_map: FxIndexMap, } -pub(super) struct SavedQueryState { - database_key_index: DatabaseKeyIndex, - durability: Durability, - changed_at: Revision, - input_outputs_len: usize, - untracked_read: bool, -} - -impl SavedQueryState { - fn new(query: &ActiveQuery) -> Self { - Self { - database_key_index: query.database_key_index, - durability: query.durability, - changed_at: query.changed_at, - input_outputs_len: query.input_outputs.len(), - untracked_read: query.untracked_read, - } - } -} - impl ActiveQuery { pub(super) fn new(database_key_index: DatabaseKeyIndex) -> Self { ActiveQuery { @@ -73,26 +53,6 @@ impl ActiveQuery { } } - pub(super) fn save_query_state(&self) -> SavedQueryState { - SavedQueryState::new(self) - } - - pub(super) fn restore_query_state(&mut self, state: SavedQueryState) { - assert_eq!(self.database_key_index, state.database_key_index); - - assert!(self.durability <= state.durability); - self.durability = state.durability; - - assert!(self.changed_at >= state.changed_at); - self.changed_at = state.changed_at; - - assert!(self.input_outputs.len() >= state.input_outputs_len); - self.input_outputs.truncate(state.input_outputs_len); - - assert!(self.untracked_read >= state.untracked_read); - self.untracked_read = state.untracked_read; - } - pub(super) fn add_read( &mut self, input: DependencyIndex, diff --git a/src/runtime/local_state.rs b/src/runtime/local_state.rs index 682434af..53076a1e 100644 --- a/src/runtime/local_state.rs +++ b/src/runtime/local_state.rs @@ -183,25 +183,6 @@ impl LocalState { self.with_query_stack(|stack| !stack.is_empty()) } - /// Dangerous operation: executes `op` but ignores its effect on - /// the query dependencies. Useful for debugging statements, but - /// otherwise not to be toyed with! - pub(super) fn debug_probe(&self, op: impl FnOnce() -> R) -> R { - let saved_state: Option<_> = - self.with_query_stack(|stack| Some(stack.last()?.save_query_state())); - - let result = op(); - - if let Some(saved_state) = saved_state { - self.with_query_stack(|stack| { - let active_query = stack.last_mut().expect("query stack not empty"); - active_query.restore_query_state(saved_state); - }); - } - - result - } - /// Returns the index of the active query along with its *current* durability/changed-at /// information. As the query continues to execute, naturally, that information may change. pub(super) fn active_query(&self) -> Option<(DatabaseKeyIndex, StampedValue<()>)> {