diff options
Diffstat (limited to 'crates/ra_hir/src/lang_item.rs')
-rw-r--r-- | crates/ra_hir/src/lang_item.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/crates/ra_hir/src/lang_item.rs b/crates/ra_hir/src/lang_item.rs index 5f3f91cba..4cacaeba4 100644 --- a/crates/ra_hir/src/lang_item.rs +++ b/crates/ra_hir/src/lang_item.rs | |||
@@ -4,7 +4,7 @@ use rustc_hash::FxHashMap; | |||
4 | use ra_syntax::{SmolStr, ast::AttrsOwner}; | 4 | use ra_syntax::{SmolStr, ast::AttrsOwner}; |
5 | 5 | ||
6 | use crate::{ | 6 | use crate::{ |
7 | Crate, DefDatabase, Enum, Function, HirDatabase, ImplBlock, Module, Static, Struct, Trait | 7 | Crate, DefDatabase, Enum, Function, HirDatabase, ImplBlock, Module, Static, Struct, Trait, AstDatabase, |
8 | }; | 8 | }; |
9 | 9 | ||
10 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 10 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
@@ -41,7 +41,10 @@ impl LangItems { | |||
41 | } | 41 | } |
42 | 42 | ||
43 | /// Salsa query. This will look for lang items in a specific crate. | 43 | /// Salsa query. This will look for lang items in a specific crate. |
44 | pub(crate) fn lang_items_query(db: &impl DefDatabase, krate: Crate) -> Arc<LangItems> { | 44 | pub(crate) fn lang_items_query( |
45 | db: &(impl DefDatabase + AstDatabase), | ||
46 | krate: Crate, | ||
47 | ) -> Arc<LangItems> { | ||
45 | let mut lang_items = LangItems { items: FxHashMap::default() }; | 48 | let mut lang_items = LangItems { items: FxHashMap::default() }; |
46 | 49 | ||
47 | if let Some(module) = krate.root_module(db) { | 50 | if let Some(module) = krate.root_module(db) { |
@@ -74,7 +77,11 @@ impl LangItems { | |||
74 | } | 77 | } |
75 | } | 78 | } |
76 | 79 | ||
77 | fn collect_lang_items_recursive(&mut self, db: &impl DefDatabase, module: &Module) { | 80 | fn collect_lang_items_recursive( |
81 | &mut self, | ||
82 | db: &(impl DefDatabase + AstDatabase), | ||
83 | module: &Module, | ||
84 | ) { | ||
78 | // Look for impl targets | 85 | // Look for impl targets |
79 | let (impl_blocks, source_map) = db.impls_in_module_with_source_map(module.clone()); | 86 | let (impl_blocks, source_map) = db.impls_in_module_with_source_map(module.clone()); |
80 | let source = module.definition_source(db).1; | 87 | let source = module.definition_source(db).1; |