aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_db/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-07 09:14:48 +0100
committerAleksey Kladov <[email protected]>2020-07-07 09:14:48 +0100
commit4bbc385277bcab509c321b1374f72f1ef19d7750 (patch)
tree74488258fb566dc4344165ade6067d8f2ce7298f /crates/ra_db/src
parentd4bc2f25de6297c75f7b7f029df224b650ef3143 (diff)
Switch to fully dynamically dispatched salsa
This improves compile times quite a bit
Diffstat (limited to 'crates/ra_db/src')
-rw-r--r--crates/ra_db/src/lib.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs
index 1ddacc1f6..590efffa4 100644
--- a/crates/ra_db/src/lib.rs
+++ b/crates/ra_db/src/lib.rs
@@ -113,7 +113,7 @@ pub trait SourceDatabase: CheckCanceled + FileLoader + std::fmt::Debug {
113 fn crate_graph(&self) -> Arc<CrateGraph>; 113 fn crate_graph(&self) -> Arc<CrateGraph>;
114} 114}
115 115
116fn parse_query(db: &impl SourceDatabase, file_id: FileId) -> Parse<ast::SourceFile> { 116fn parse_query(db: &dyn SourceDatabase, file_id: FileId) -> Parse<ast::SourceFile> {
117 let _p = profile("parse_query").detail(|| format!("{:?}", file_id)); 117 let _p = profile("parse_query").detail(|| format!("{:?}", file_id));
118 let text = db.file_text(file_id); 118 let text = db.file_text(file_id);
119 SourceFile::parse(&*text) 119 SourceFile::parse(&*text)
@@ -136,10 +136,7 @@ pub trait SourceDatabaseExt: SourceDatabase {
136 fn source_root_crates(&self, id: SourceRootId) -> Arc<FxHashSet<CrateId>>; 136 fn source_root_crates(&self, id: SourceRootId) -> Arc<FxHashSet<CrateId>>;
137} 137}
138 138
139fn source_root_crates( 139fn source_root_crates(db: &dyn SourceDatabaseExt, id: SourceRootId) -> Arc<FxHashSet<CrateId>> {
140 db: &(impl SourceDatabaseExt + SourceDatabase),
141 id: SourceRootId,
142) -> Arc<FxHashSet<CrateId>> {
143 let graph = db.crate_graph(); 140 let graph = db.crate_graph();
144 let res = graph 141 let res = graph
145 .iter() 142 .iter()