From 47be3a3a24de1eb28e1575db1571d934765f6d53 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 15 Sep 2018 13:38:31 +0300 Subject: renames --- crates/libanalysis/src/db/mod.rs | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'crates/libanalysis/src/db') diff --git a/crates/libanalysis/src/db/mod.rs b/crates/libanalysis/src/db/mod.rs index f68aab61c..3198272b7 100644 --- a/crates/libanalysis/src/db/mod.rs +++ b/crates/libanalysis/src/db/mod.rs @@ -120,38 +120,36 @@ impl<'a> QueryCtx<'a> { fn query_config() -> salsa::QueryConfig { let mut res = salsa::QueryConfig::new(); - let queries: Vec = vec![ + let queries: Vec = vec![ queries::FILE_TEXT.into(), queries::FILE_SET.into(), ]; for q in queries { res = res.with_ground_query(q.query_type, q.f) } - let queries: Vec = vec![ + let mut queries: Vec = vec![ queries::FILE_SYNTAX.into(), - ::module_map_db::MODULE_DESCR.into(), - ::module_map_db::RESOLVE_SUBMODULE.into(), - ::module_map_db::PARENT_MODULE.into(), ]; + ::module_map_db::queries(&mut queries); for q in queries { res = res.with_query(q.query_type, q.f); } res } -struct SalsaGroundQuery { +struct BoxedGroundQuery { query_type: salsa::QueryTypeId, f: Box (Data, salsa::OutputFingerprint) + Send + Sync + 'static>, } -impl From> for SalsaGroundQuery +impl From> for BoxedGroundQuery where T: Send + Sync + 'static, R: Send + Sync + 'static, { - fn from(q: GroundQuery) -> SalsaGroundQuery + fn from(q: GroundQuery) -> BoxedGroundQuery { - SalsaGroundQuery { + BoxedGroundQuery { query_type: salsa::QueryTypeId(q.id), f: Box::new(move |state, data| { let data: &T = data.downcast_ref().unwrap(); @@ -163,19 +161,19 @@ where } } -struct SalsaQuery { +pub(crate) struct BoxedQuery { query_type: salsa::QueryTypeId, f: Box, &Data) -> (Data, salsa::OutputFingerprint) + Send + Sync + 'static>, } -impl From> for SalsaQuery +impl From> for BoxedQuery where T: Hash + Send + Sync + 'static, R: Hash + Send + Sync + 'static, { - fn from(q: Query) -> SalsaQuery + fn from(q: Query) -> BoxedQuery { - SalsaQuery { + BoxedQuery { query_type: salsa::QueryTypeId(q.id), f: Box::new(move |ctx, data| { let ctx = QueryCtx { inner: ctx }; -- cgit v1.2.3