aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/test_db.rs
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-06-03 15:11:20 +0100
committerJonas Schievink <[email protected]>2021-06-03 17:09:21 +0100
commit9fdb8f90376c02ec2a267cf9eb3bdb7b6027e1e6 (patch)
treeb816f97fd66df5bb827d7e2456b6a492a7199d34 /crates/hir_def/src/test_db.rs
parente5a2c6596ddd11b0d57042224ac7c1d7691ec33b (diff)
Make it opt-in
Diffstat (limited to 'crates/hir_def/src/test_db.rs')
-rw-r--r--crates/hir_def/src/test_db.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/hir_def/src/test_db.rs b/crates/hir_def/src/test_db.rs
index e840fe5e8..b20b066e2 100644
--- a/crates/hir_def/src/test_db.rs
+++ b/crates/hir_def/src/test_db.rs
@@ -30,12 +30,19 @@ use crate::{
30 crate::db::InternDatabaseStorage, 30 crate::db::InternDatabaseStorage,
31 crate::db::DefDatabaseStorage 31 crate::db::DefDatabaseStorage
32)] 32)]
33#[derive(Default)]
34pub(crate) struct TestDB { 33pub(crate) struct TestDB {
35 storage: salsa::Storage<TestDB>, 34 storage: salsa::Storage<TestDB>,
36 events: Mutex<Option<Vec<salsa::Event>>>, 35 events: Mutex<Option<Vec<salsa::Event>>>,
37} 36}
38 37
38impl Default for TestDB {
39 fn default() -> Self {
40 let mut this = Self { storage: Default::default(), events: Default::default() };
41 this.set_enable_proc_attr_macros(true);
42 this
43 }
44}
45
39impl Upcast<dyn AstDatabase> for TestDB { 46impl Upcast<dyn AstDatabase> for TestDB {
40 fn upcast(&self) -> &(dyn AstDatabase + 'static) { 47 fn upcast(&self) -> &(dyn AstDatabase + 'static) {
41 &*self 48 &*self