Make it opt-in

This commit is contained in:
Jonas Schievink 2021-06-03 16:11:20 +02:00
parent e5a2c6596d
commit 9fdb8f9037
9 changed files with 44 additions and 4 deletions

View file

@ -30,12 +30,19 @@ use crate::{
crate::db::InternDatabaseStorage,
crate::db::DefDatabaseStorage
)]
#[derive(Default)]
pub(crate) struct TestDB {
storage: salsa::Storage<TestDB>,
events: Mutex<Option<Vec<salsa::Event>>>,
}
impl Default for TestDB {
fn default() -> Self {
let mut this = Self { storage: Default::default(), events: Default::default() };
this.set_enable_proc_attr_macros(true);
this
}
}
impl Upcast<dyn AstDatabase> for TestDB {
fn upcast(&self) -> &(dyn AstDatabase + 'static) {
&*self