diff --git a/src/derived.rs b/src/derived.rs index dcebf4f2..f9ea5a0a 100644 --- a/src/derived.rs +++ b/src/derived.rs @@ -4,7 +4,6 @@ use crate::plumbing::DatabaseKey; use crate::plumbing::QueryFunction; use crate::plumbing::QueryStorageMassOps; use crate::plumbing::QueryStorageOps; -use crate::plumbing::UncheckedMutQueryStorageOps; use crate::runtime::ChangedAt; use crate::runtime::FxIndexSet; use crate::runtime::Revision; @@ -983,31 +982,6 @@ where } } -impl UncheckedMutQueryStorageOps for DerivedStorage -where - Q: QueryFunction, - DB: Database, - MP: MemoizationPolicy, -{ - fn set_unchecked(&self, db: &DB, key: &Q::Key, value: Q::Value) { - let key = key.clone(); - - let mut map_write = self.map.write(); - let current_revision = db.salsa_runtime().current_revision(); - map_write.insert( - key, - QueryState::Memoized(Memo { - value: Some(value), - changed_at: current_revision, - verified_at: current_revision, - inputs: MemoInputs::Tracked { - inputs: Default::default(), - }, - }), - ); - } -} - impl Memo where Q: QueryFunction, diff --git a/src/input.rs b/src/input.rs index dc534aef..05b74b46 100644 --- a/src/input.rs +++ b/src/input.rs @@ -3,7 +3,6 @@ use crate::plumbing::CycleDetected; use crate::plumbing::InputQueryStorageOps; use crate::plumbing::QueryStorageMassOps; use crate::plumbing::QueryStorageOps; -use crate::plumbing::UncheckedMutQueryStorageOps; use crate::runtime::ChangedAt; use crate::runtime::Revision; use crate::runtime::StampedValue; @@ -233,24 +232,3 @@ where self.set_common(db, key, database_key, value, IsConstant(true)) } } - -impl UncheckedMutQueryStorageOps for InputStorage -where - Q: Query, - DB: Database, -{ - fn set_unchecked(&self, db: &DB, key: &Q::Key, value: Q::Value) { - let key = key.clone(); - - let mut map_write = self.map.write(); - - // Unlike with `set`, here we use the **current revision** and - // do not create a new one. - let changed_at = ChangedAt { - is_constant: false, - revision: db.salsa_runtime().current_revision(), - }; - - map_write.insert(key, StampedValue { value, changed_at }); - } -} diff --git a/src/lib.rs b/src/lib.rs index 462d20d0..d0b2da74 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,7 +22,6 @@ use crate::plumbing::CycleDetected; use crate::plumbing::InputQueryStorageOps; use crate::plumbing::QueryStorageMassOps; use crate::plumbing::QueryStorageOps; -use crate::plumbing::UncheckedMutQueryStorageOps; use derive_new::new; use std::fmt::{self, Debug}; use std::hash::Hash; diff --git a/src/plumbing.rs b/src/plumbing.rs index 29e3f553..ee759587 100644 --- a/src/plumbing.rs +++ b/src/plumbing.rs @@ -201,14 +201,3 @@ where new_value: Q::Value, ); } - -/// An optional trait that is implemented for "user mutable" storage: -/// that is, storage whose value is not derived from other storage but -/// is set independently. -pub trait UncheckedMutQueryStorageOps: Default -where - DB: Database, - Q: Query, -{ - fn set_unchecked(&self, db: &DB, key: &Q::Key, new_value: Q::Value); -}