diff options
author | Aleksey Kladov <[email protected]> | 2018-10-15 19:25:54 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-10-15 19:25:54 +0100 |
commit | 062019590d70279d82fef3a60a2caf9490f8b97b (patch) | |
tree | 9519620f51adfe64716d3ec8f11ecf88bfad0839 /crates/ra_analysis | |
parent | d783371b862c15d6d402d68e8edce4e37d63796c (diff) |
Switch to the master of salsa
Diffstat (limited to 'crates/ra_analysis')
-rw-r--r-- | crates/ra_analysis/Cargo.toml | 3 | ||||
-rw-r--r-- | crates/ra_analysis/src/db/mod.rs | 4 | ||||
-rw-r--r-- | crates/ra_analysis/src/roots.rs | 8 |
3 files changed, 8 insertions, 7 deletions
diff --git a/crates/ra_analysis/Cargo.toml b/crates/ra_analysis/Cargo.toml index 4481e98d6..233f34e34 100644 --- a/crates/ra_analysis/Cargo.toml +++ b/crates/ra_analysis/Cargo.toml | |||
@@ -15,7 +15,8 @@ fst = "0.3.1" | |||
15 | im = "12.0.0" | 15 | im = "12.0.0" |
16 | ra_syntax = { path = "../ra_syntax" } | 16 | ra_syntax = { path = "../ra_syntax" } |
17 | ra_editor = { path = "../ra_editor" } | 17 | ra_editor = { path = "../ra_editor" } |
18 | salsa = "0.4.1" | 18 | salsa = { git = "https://github.com/salsa-rs/salsa", rev = "20c9fbf" } |
19 | rustc-hash = "1.0" | ||
19 | 20 | ||
20 | [dev-dependencies] | 21 | [dev-dependencies] |
21 | test_utils = { path = "../test_utils" } | 22 | test_utils = { path = "../test_utils" } |
diff --git a/crates/ra_analysis/src/db/mod.rs b/crates/ra_analysis/src/db/mod.rs index c54d50252..c84bfa7a8 100644 --- a/crates/ra_analysis/src/db/mod.rs +++ b/crates/ra_analysis/src/db/mod.rs | |||
@@ -2,9 +2,9 @@ use std::{ | |||
2 | fmt, | 2 | fmt, |
3 | sync::Arc, | 3 | sync::Arc, |
4 | hash::{Hash, Hasher}, | 4 | hash::{Hash, Hasher}, |
5 | collections::HashSet, | ||
6 | }; | 5 | }; |
7 | use salsa; | 6 | use salsa; |
7 | use rustc_hash::FxHashSet; | ||
8 | use ra_syntax::File; | 8 | use ra_syntax::File; |
9 | use ra_editor::{LineIndex}; | 9 | use ra_editor::{LineIndex}; |
10 | use crate::{ | 10 | use crate::{ |
@@ -63,7 +63,7 @@ salsa::query_group! { | |||
63 | 63 | ||
64 | #[derive(Default, Debug)] | 64 | #[derive(Default, Debug)] |
65 | pub(crate) struct FileSet { | 65 | pub(crate) struct FileSet { |
66 | pub(crate) files: HashSet<FileId>, | 66 | pub(crate) files: FxHashSet<FileId>, |
67 | pub(crate) resolver: FileResolverImp, | 67 | pub(crate) resolver: FileResolverImp, |
68 | } | 68 | } |
69 | 69 | ||
diff --git a/crates/ra_analysis/src/roots.rs b/crates/ra_analysis/src/roots.rs index 908f49b0a..692a07ccd 100644 --- a/crates/ra_analysis/src/roots.rs +++ b/crates/ra_analysis/src/roots.rs | |||
@@ -1,5 +1,4 @@ | |||
1 | use std::{ | 1 | use std::{ |
2 | collections::{HashMap, HashSet}, | ||
3 | sync::Arc, | 2 | sync::Arc, |
4 | panic, | 3 | panic, |
5 | }; | 4 | }; |
@@ -8,6 +7,7 @@ use parking_lot::RwLock; | |||
8 | use once_cell::sync::OnceCell; | 7 | use once_cell::sync::OnceCell; |
9 | use rayon::prelude::*; | 8 | use rayon::prelude::*; |
10 | use salsa::Database; | 9 | use salsa::Database; |
10 | use rustc_hash::{FxHashMap, FxHashSet}; | ||
11 | use ra_editor::LineIndex; | 11 | use ra_editor::LineIndex; |
12 | use ra_syntax::File; | 12 | use ra_syntax::File; |
13 | 13 | ||
@@ -40,8 +40,8 @@ impl WritableSourceRoot { | |||
40 | file_resolver: Option<FileResolverImp>, | 40 | file_resolver: Option<FileResolverImp>, |
41 | ) -> WritableSourceRoot { | 41 | ) -> WritableSourceRoot { |
42 | let db = self.db.write(); | 42 | let db = self.db.write(); |
43 | let mut changed = HashSet::new(); | 43 | let mut changed = FxHashSet::default(); |
44 | let mut removed = HashSet::new(); | 44 | let mut removed = FxHashSet::default(); |
45 | for (file_id, text) in changes { | 45 | for (file_id, text) in changes { |
46 | match text { | 46 | match text { |
47 | None => { | 47 | None => { |
@@ -55,7 +55,7 @@ impl WritableSourceRoot { | |||
55 | } | 55 | } |
56 | } | 56 | } |
57 | let file_set = db.file_set(()); | 57 | let file_set = db.file_set(()); |
58 | let mut files: HashSet<FileId> = file_set | 58 | let mut files: FxHashSet<FileId> = file_set |
59 | .files | 59 | .files |
60 | .clone(); | 60 | .clone(); |
61 | for file_id in removed { | 61 | for file_id in removed { |