aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres
diff options
context:
space:
mode:
authorcsmoe <[email protected]>2019-02-01 10:33:41 +0000
committercsmoe <[email protected]>2019-02-01 14:05:24 +0000
commit4dffdcf14abe0c79f9d7a9702be77958be1f75b1 (patch)
tree3904cb714292f3e1abe5081e4e516eea1b2568fa /crates/ra_hir/src/nameres
parent12433a78871610edfccc82442846615872747e06 (diff)
split HirDatabase api
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r--crates/ra_hir/src/nameres/lower.rs14
-rw-r--r--crates/ra_hir/src/nameres/tests.rs2
2 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_hir/src/nameres/lower.rs b/crates/ra_hir/src/nameres/lower.rs
index 8df11a5f4..9a45fa61c 100644
--- a/crates/ra_hir/src/nameres/lower.rs
+++ b/crates/ra_hir/src/nameres/lower.rs
@@ -8,10 +8,10 @@ use ra_arena::{Arena, RawId, impl_arena_id, map::ArenaMap};
8use rustc_hash::FxHashMap; 8use rustc_hash::FxHashMap;
9 9
10use crate::{ 10use crate::{
11 SourceItemId, Path, ModuleSource, HirDatabase, Name, 11 SourceItemId, Path, ModuleSource, Name,
12 HirFileId, MacroCallLoc, AsName, PerNs, Function, 12 HirFileId, MacroCallLoc, AsName, PerNs, Function,
13 ModuleDef, Module, Struct, Enum, Const, Static, Trait, Type, 13 ModuleDef, Module, Struct, Enum, Const, Static, Trait, Type,
14 ids::LocationCtx, 14 ids::LocationCtx, PersistentHirDatabase,
15}; 15};
16 16
17#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 17#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
@@ -58,21 +58,21 @@ impl ImportSourceMap {
58 58
59impl LoweredModule { 59impl LoweredModule {
60 pub(crate) fn lower_module_module_query( 60 pub(crate) fn lower_module_module_query(
61 db: &impl HirDatabase, 61 db: &impl PersistentHirDatabase,
62 module: Module, 62 module: Module,
63 ) -> Arc<LoweredModule> { 63 ) -> Arc<LoweredModule> {
64 db.lower_module(module).0 64 db.lower_module(module).0
65 } 65 }
66 66
67 pub(crate) fn lower_module_source_map_query( 67 pub(crate) fn lower_module_source_map_query(
68 db: &impl HirDatabase, 68 db: &impl PersistentHirDatabase,
69 module: Module, 69 module: Module,
70 ) -> Arc<ImportSourceMap> { 70 ) -> Arc<ImportSourceMap> {
71 db.lower_module(module).1 71 db.lower_module(module).1
72 } 72 }
73 73
74 pub(crate) fn lower_module_query( 74 pub(crate) fn lower_module_query(
75 db: &impl HirDatabase, 75 db: &impl PersistentHirDatabase,
76 module: Module, 76 module: Module,
77 ) -> (Arc<LoweredModule>, Arc<ImportSourceMap>) { 77 ) -> (Arc<LoweredModule>, Arc<ImportSourceMap>) {
78 let (file_id, source) = module.definition_source(db); 78 let (file_id, source) = module.definition_source(db);
@@ -105,7 +105,7 @@ impl LoweredModule {
105 fn fill( 105 fn fill(
106 &mut self, 106 &mut self,
107 source_map: &mut ImportSourceMap, 107 source_map: &mut ImportSourceMap,
108 db: &impl HirDatabase, 108 db: &impl PersistentHirDatabase,
109 module: Module, 109 module: Module,
110 file_id: HirFileId, 110 file_id: HirFileId,
111 items: &mut Iterator<Item = ast::ItemOrMacro>, 111 items: &mut Iterator<Item = ast::ItemOrMacro>,
@@ -137,7 +137,7 @@ impl LoweredModule {
137 fn add_def_id( 137 fn add_def_id(
138 &mut self, 138 &mut self,
139 source_map: &mut ImportSourceMap, 139 source_map: &mut ImportSourceMap,
140 db: &impl HirDatabase, 140 db: &impl PersistentHirDatabase,
141 module: Module, 141 module: Module,
142 file_id: HirFileId, 142 file_id: HirFileId,
143 item: &ast::ModuleItem, 143 item: &ast::ModuleItem,
diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs
index 9c5ca097e..1ce7bd146 100644
--- a/crates/ra_hir/src/nameres/tests.rs
+++ b/crates/ra_hir/src/nameres/tests.rs
@@ -6,7 +6,7 @@ use test_utils::{assert_eq_text, covers};
6 6
7use crate::{ 7use crate::{
8 ItemMap, Resolution, 8 ItemMap, Resolution,
9 db::HirDatabase, 9 PersistentHirDatabase,
10 mock::MockDatabase, 10 mock::MockDatabase,
11 module_tree::ModuleId, 11 module_tree::ModuleId,
12}; 12};