From 73dd870da2dcc991b0fdcdde8bee91f05cb9e182 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 20 Oct 2018 18:43:02 +0300 Subject: update salsa --- crates/ra_analysis/Cargo.toml | 2 +- crates/ra_analysis/src/db.rs | 6 +++--- crates/ra_analysis/src/module_map.rs | 6 +++--- crates/ra_analysis/src/roots.rs | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'crates') diff --git a/crates/ra_analysis/Cargo.toml b/crates/ra_analysis/Cargo.toml index 17b04182f..dd4ec8375 100644 --- a/crates/ra_analysis/Cargo.toml +++ b/crates/ra_analysis/Cargo.toml @@ -15,7 +15,7 @@ fst = "0.3.1" im = "12.0.0" ra_syntax = { path = "../ra_syntax" } ra_editor = { path = "../ra_editor" } -salsa = "0.5.0" +salsa = "0.6.0" rustc-hash = "1.0" [dev-dependencies] diff --git a/crates/ra_analysis/src/db.rs b/crates/ra_analysis/src/db.rs index 042dde1ac..cce959669 100644 --- a/crates/ra_analysis/src/db.rs +++ b/crates/ra_analysis/src/db.rs @@ -16,7 +16,7 @@ use std::{ #[derive(Default)] pub(crate) struct RootDatabase { - runtime: salsa::runtime::Runtime, + runtime: salsa::Runtime, } impl fmt::Debug for RootDatabase { @@ -26,7 +26,7 @@ impl fmt::Debug for RootDatabase { } impl salsa::Database for RootDatabase { - fn salsa_runtime(&self) -> &salsa::runtime::Runtime { + fn salsa_runtime(&self) -> &salsa::Runtime { &self.runtime } } @@ -69,7 +69,7 @@ salsa::query_group! { type FileTextQuery; storage input; } - fn file_set(key: ()) -> Arc { + fn file_set() -> Arc { type FileSetQuery; storage input; } diff --git a/crates/ra_analysis/src/module_map.rs b/crates/ra_analysis/src/module_map.rs index ff0ec3cc7..b15432498 100644 --- a/crates/ra_analysis/src/module_map.rs +++ b/crates/ra_analysis/src/module_map.rs @@ -8,7 +8,7 @@ use std::sync::Arc; salsa::query_group! { pub(crate) trait ModulesDatabase: SyntaxDatabase { - fn module_tree(key: ()) -> Arc { + fn module_tree() -> Arc { type ModuleTreeQuery; } fn module_descriptor(file_id: FileId) -> Arc { @@ -22,8 +22,8 @@ fn module_descriptor(db: &impl ModulesDatabase, file_id: FileId) -> Arc Arc { - let file_set = db.file_set(()); +fn module_tree(db: &impl ModulesDatabase) -> Arc { + let file_set = db.file_set(); let mut files = Vec::new(); for &file_id in file_set.files.iter() { let module_descr = db.module_descriptor(file_id); diff --git a/crates/ra_analysis/src/roots.rs b/crates/ra_analysis/src/roots.rs index 1f2b21b27..19c84df65 100644 --- a/crates/ra_analysis/src/roots.rs +++ b/crates/ra_analysis/src/roots.rs @@ -50,7 +50,7 @@ impl WritableSourceRoot { } } } - let file_set = self.db.file_set(()); + let file_set = self.db.file_set(); let mut files: FxHashSet = file_set.files.clone(); for file_id in removed { files.remove(&file_id); @@ -65,10 +65,10 @@ impl WritableSourceRoot { impl SourceRoot for WritableSourceRoot { fn module_tree(&self) -> Arc { - self.db.module_tree(()) + self.db.module_tree() } fn contains(&self, file_id: FileId) -> bool { - self.db.file_set(()).files.contains(&file_id) + self.db.file_set().files.contains(&file_id) } fn lines(&self, file_id: FileId) -> Arc { self.db.file_lines(file_id) @@ -78,7 +78,7 @@ impl SourceRoot for WritableSourceRoot { } fn symbols<'a>(&'a self, acc: &mut Vec>) { let db = &self.db; - let symbols = db.file_set(()); + let symbols = db.file_set(); let symbols = symbols .files .iter() -- cgit v1.2.3