From 73dd870da2dcc991b0fdcdde8bee91f05cb9e182 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 20 Oct 2018 18:43:02 +0300 Subject: [PATCH] update salsa --- Cargo.lock | 6 +++--- 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 ++++---- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bb93b8b0e1..bb0feec2ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -620,7 +620,7 @@ dependencies = [ "rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "relative-path 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "salsa 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "salsa 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "test_utils 0.1.0", ] @@ -845,7 +845,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "salsa" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "derive-new 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1361,7 +1361,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7" "checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9" -"checksum salsa 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8301c563959d6d50fe0a34817f0d9ff08fe12eda7456e01e2bbde1588ea30602" +"checksum salsa 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6c8f8b59428c040fbac0f6a2e698ae892e33d23d7519713ba8b243edb3082dad" "checksum same-file 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10f7794e2fda7f594866840e95f5c5962e886e228e68b6505885811a94dd728c" "checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" diff --git a/crates/ra_analysis/Cargo.toml b/crates/ra_analysis/Cargo.toml index 17b04182fb..dd4ec83752 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 042dde1aca..cce9596696 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 ff0ec3cc7b..b15432498c 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 1f2b21b272..19c84df65a 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()