diff options
Diffstat (limited to 'crates/ra_hir/src/impl_block.rs')
-rw-r--r-- | crates/ra_hir/src/impl_block.rs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/crates/ra_hir/src/impl_block.rs b/crates/ra_hir/src/impl_block.rs index 072670444..ba90e67e9 100644 --- a/crates/ra_hir/src/impl_block.rs +++ b/crates/ra_hir/src/impl_block.rs | |||
@@ -8,7 +8,7 @@ use ra_syntax::{ | |||
8 | }; | 8 | }; |
9 | 9 | ||
10 | use crate::{ | 10 | use crate::{ |
11 | Const, TypeAlias, Function, HirFileId, | 11 | Const, TypeAlias, Function, HirFileId, AstDatabase, |
12 | HirDatabase, DefDatabase, TraitRef, | 12 | HirDatabase, DefDatabase, TraitRef, |
13 | type_ref::TypeRef, | 13 | type_ref::TypeRef, |
14 | ids::LocationCtx, | 14 | ids::LocationCtx, |
@@ -58,7 +58,10 @@ impl ImplBlock { | |||
58 | } | 58 | } |
59 | 59 | ||
60 | /// Returns the syntax of the impl block | 60 | /// Returns the syntax of the impl block |
61 | pub fn source(&self, db: &impl DefDatabase) -> (HirFileId, TreeArc<ast::ImplBlock>) { | 61 | pub fn source( |
62 | &self, | ||
63 | db: &(impl DefDatabase + AstDatabase), | ||
64 | ) -> (HirFileId, TreeArc<ast::ImplBlock>) { | ||
62 | let source_map = db.impls_in_module_with_source_map(self.module).1; | 65 | let source_map = db.impls_in_module_with_source_map(self.module).1; |
63 | let (file_id, source) = self.module.definition_source(db); | 66 | let (file_id, source) = self.module.definition_source(db); |
64 | (file_id, source_map.get(&source, self.impl_id)) | 67 | (file_id, source_map.get(&source, self.impl_id)) |
@@ -117,7 +120,7 @@ pub struct ImplData { | |||
117 | 120 | ||
118 | impl ImplData { | 121 | impl ImplData { |
119 | pub(crate) fn from_ast( | 122 | pub(crate) fn from_ast( |
120 | db: &impl DefDatabase, | 123 | db: &(impl DefDatabase + AstDatabase), |
121 | file_id: HirFileId, | 124 | file_id: HirFileId, |
122 | module: Module, | 125 | module: Module, |
123 | node: &ast::ImplBlock, | 126 | node: &ast::ImplBlock, |
@@ -187,7 +190,11 @@ pub struct ModuleImplBlocks { | |||
187 | } | 190 | } |
188 | 191 | ||
189 | impl ModuleImplBlocks { | 192 | impl ModuleImplBlocks { |
190 | fn collect(db: &impl DefDatabase, module: Module, source_map: &mut ImplSourceMap) -> Self { | 193 | fn collect( |
194 | db: &(impl DefDatabase + AstDatabase), | ||
195 | module: Module, | ||
196 | source_map: &mut ImplSourceMap, | ||
197 | ) -> Self { | ||
191 | let mut m = ModuleImplBlocks { | 198 | let mut m = ModuleImplBlocks { |
192 | module, | 199 | module, |
193 | impls: Arena::default(), | 200 | impls: Arena::default(), |
@@ -218,7 +225,7 @@ impl ModuleImplBlocks { | |||
218 | } | 225 | } |
219 | 226 | ||
220 | pub(crate) fn impls_in_module_with_source_map_query( | 227 | pub(crate) fn impls_in_module_with_source_map_query( |
221 | db: &impl DefDatabase, | 228 | db: &(impl DefDatabase + AstDatabase), |
222 | module: Module, | 229 | module: Module, |
223 | ) -> (Arc<ModuleImplBlocks>, Arc<ImplSourceMap>) { | 230 | ) -> (Arc<ModuleImplBlocks>, Arc<ImplSourceMap>) { |
224 | let mut source_map = ImplSourceMap::default(); | 231 | let mut source_map = ImplSourceMap::default(); |