diff --git a/tests/no_send_sync.rs b/tests/no_send_sync.rs new file mode 100644 index 00000000..3e41533e --- /dev/null +++ b/tests/no_send_sync.rs @@ -0,0 +1,35 @@ +#[macro_use] +extern crate salsa; + +use std::rc::Rc; + +// #[derive(Clone, PartialEq, Eq, Debug)] +// struct Dummy; + +#[salsa::query_group(NoSendStorage)] +trait NoSendDatabase: salsa::Database { + fn query(&self, key: ()) -> Rc; +} + +fn query(db: &impl NoSendDatabase, (): ()) -> Rc { + Rc::new(true) +} + +#[salsa::database(NoSendStorage)] +#[derive(Default)] +struct DatabaseImpl { + runtime: salsa::Runtime, +} + +impl salsa::Database for DatabaseImpl { + fn salsa_runtime(&self) -> &salsa::Runtime { + &self.runtime + } +} + +#[test] +fn no_send_sync() { + let mut db = DatabaseImpl::default(); + + db.query(()); +}