From 4bbc385277bcab509c321b1374f72f1ef19d7750 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 7 Jul 2020 10:14:48 +0200 Subject: Switch to fully dynamically dispatched salsa This improves compile times quite a bit --- crates/ra_db/Cargo.toml | 2 +- crates/ra_db/src/lib.rs | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'crates/ra_db') diff --git a/crates/ra_db/Cargo.toml b/crates/ra_db/Cargo.toml index 372fb242b..b2d481dfb 100644 --- a/crates/ra_db/Cargo.toml +++ b/crates/ra_db/Cargo.toml @@ -8,7 +8,7 @@ authors = ["rust-analyzer developers"] doctest = false [dependencies] -salsa = "0.14.1" +salsa = { git = "https://github.com/nikomatsakis/salsa", branch = "dynamic-databases-rfc" } relative-path = "1.0.0" rustc-hash = "1.1.0" 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 { fn crate_graph(&self) -> Arc; } -fn parse_query(db: &impl SourceDatabase, file_id: FileId) -> Parse { +fn parse_query(db: &dyn SourceDatabase, file_id: FileId) -> Parse { let _p = profile("parse_query").detail(|| format!("{:?}", file_id)); let text = db.file_text(file_id); SourceFile::parse(&*text) @@ -136,10 +136,7 @@ pub trait SourceDatabaseExt: SourceDatabase { fn source_root_crates(&self, id: SourceRootId) -> Arc>; } -fn source_root_crates( - db: &(impl SourceDatabaseExt + SourceDatabase), - id: SourceRootId, -) -> Arc> { +fn source_root_crates(db: &dyn SourceDatabaseExt, id: SourceRootId) -> Arc> { let graph = db.crate_graph(); let res = graph .iter() -- cgit v1.2.3