diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-01 14:31:23 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-01 14:31:23 +0000 |
commit | 2b5c226e86892113bcab478cdf4c9adaf1e7b2f6 (patch) | |
tree | 3904cb714292f3e1abe5081e4e516eea1b2568fa /crates/ra_hir/src/impl_block.rs | |
parent | 21c593593163c22b996f7c8bffe05b9708f5b2d0 (diff) | |
parent | 4dffdcf14abe0c79f9d7a9702be77958be1f75b1 (diff) |
Merge #718
718: split HirDatabase r=matklad a=csmoe
Closes #706
Co-authored-by: csmoe <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/impl_block.rs')
-rw-r--r-- | crates/ra_hir/src/impl_block.rs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/crates/ra_hir/src/impl_block.rs b/crates/ra_hir/src/impl_block.rs index 5fc26324a..36d72b103 100644 --- a/crates/ra_hir/src/impl_block.rs +++ b/crates/ra_hir/src/impl_block.rs | |||
@@ -9,7 +9,7 @@ ast::{self, AstNode}}; | |||
9 | use crate::{ | 9 | use crate::{ |
10 | Const, Type, | 10 | Const, Type, |
11 | Function, HirFileId, | 11 | Function, HirFileId, |
12 | db::HirDatabase, | 12 | PersistentHirDatabase, |
13 | type_ref::TypeRef, | 13 | type_ref::TypeRef, |
14 | ids::LocationCtx, | 14 | ids::LocationCtx, |
15 | }; | 15 | }; |
@@ -91,7 +91,7 @@ pub struct ImplData { | |||
91 | 91 | ||
92 | impl ImplData { | 92 | impl ImplData { |
93 | pub(crate) fn from_ast( | 93 | pub(crate) fn from_ast( |
94 | db: &impl HirDatabase, | 94 | db: &impl PersistentHirDatabase, |
95 | file_id: HirFileId, | 95 | file_id: HirFileId, |
96 | module: Module, | 96 | module: Module, |
97 | node: &ast::ImplBlock, | 97 | node: &ast::ImplBlock, |
@@ -174,7 +174,12 @@ impl ModuleImplBlocks { | |||
174 | } | 174 | } |
175 | } | 175 | } |
176 | 176 | ||
177 | fn collect(&mut self, db: &impl HirDatabase, module: Module, source_map: &mut ImplSourceMap) { | 177 | fn collect( |
178 | &mut self, | ||
179 | db: &impl PersistentHirDatabase, | ||
180 | module: Module, | ||
181 | source_map: &mut ImplSourceMap, | ||
182 | ) { | ||
178 | let (file_id, module_source) = module.definition_source(db); | 183 | let (file_id, module_source) = module.definition_source(db); |
179 | let file_id: HirFileId = file_id.into(); | 184 | let file_id: HirFileId = file_id.into(); |
180 | let node = match &module_source { | 185 | let node = match &module_source { |
@@ -198,7 +203,7 @@ impl ModuleImplBlocks { | |||
198 | } | 203 | } |
199 | 204 | ||
200 | pub(crate) fn impls_in_module_with_source_map_query( | 205 | pub(crate) fn impls_in_module_with_source_map_query( |
201 | db: &impl HirDatabase, | 206 | db: &impl PersistentHirDatabase, |
202 | module: Module, | 207 | module: Module, |
203 | ) -> (Arc<ModuleImplBlocks>, Arc<ImplSourceMap>) { | 208 | ) -> (Arc<ModuleImplBlocks>, Arc<ImplSourceMap>) { |
204 | let mut source_map = ImplSourceMap::default(); | 209 | let mut source_map = ImplSourceMap::default(); |
@@ -209,12 +214,15 @@ pub(crate) fn impls_in_module_with_source_map_query( | |||
209 | (Arc::new(result), Arc::new(source_map)) | 214 | (Arc::new(result), Arc::new(source_map)) |
210 | } | 215 | } |
211 | 216 | ||
212 | pub(crate) fn impls_in_module(db: &impl HirDatabase, module: Module) -> Arc<ModuleImplBlocks> { | 217 | pub(crate) fn impls_in_module( |
218 | db: &impl PersistentHirDatabase, | ||
219 | module: Module, | ||
220 | ) -> Arc<ModuleImplBlocks> { | ||
213 | db.impls_in_module_with_source_map(module).0 | 221 | db.impls_in_module_with_source_map(module).0 |
214 | } | 222 | } |
215 | 223 | ||
216 | pub(crate) fn impls_in_module_source_map_query( | 224 | pub(crate) fn impls_in_module_source_map_query( |
217 | db: &impl HirDatabase, | 225 | db: &impl PersistentHirDatabase, |
218 | module: Module, | 226 | module: Module, |
219 | ) -> Arc<ImplSourceMap> { | 227 | ) -> Arc<ImplSourceMap> { |
220 | db.impls_in_module_with_source_map(module).1 | 228 | db.impls_in_module_with_source_map(module).1 |