diff options
Diffstat (limited to 'crates/ra_hir/src/code_model/src.rs')
-rw-r--r-- | crates/ra_hir/src/code_model/src.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir/src/code_model/src.rs b/crates/ra_hir/src/code_model/src.rs index bd0c3c226..6d116ee75 100644 --- a/crates/ra_hir/src/code_model/src.rs +++ b/crates/ra_hir/src/code_model/src.rs | |||
@@ -22,7 +22,7 @@ pub trait HasSource { | |||
22 | impl Module { | 22 | impl Module { |
23 | /// Returns a node which defines this module. That is, a file or a `mod foo {}` with items. | 23 | /// Returns a node which defines this module. That is, a file or a `mod foo {}` with items. |
24 | pub fn definition_source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<ModuleSource> { | 24 | pub fn definition_source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<ModuleSource> { |
25 | let def_map = db.crate_def_map(self.krate()); | 25 | let def_map = db.crate_def_map(self.id.krate); |
26 | let decl_id = def_map[self.id.module_id].declaration; | 26 | let decl_id = def_map[self.id.module_id].declaration; |
27 | let file_id = def_map[self.id.module_id].definition; | 27 | let file_id = def_map[self.id.module_id].definition; |
28 | let ast = ModuleSource::new(db, file_id, decl_id); | 28 | let ast = ModuleSource::new(db, file_id, decl_id); |
@@ -36,7 +36,7 @@ impl Module { | |||
36 | self, | 36 | self, |
37 | db: &(impl DefDatabase + AstDatabase), | 37 | db: &(impl DefDatabase + AstDatabase), |
38 | ) -> Option<Source<ast::Module>> { | 38 | ) -> Option<Source<ast::Module>> { |
39 | let def_map = db.crate_def_map(self.krate()); | 39 | let def_map = db.crate_def_map(self.id.krate); |
40 | let decl = def_map[self.id.module_id].declaration?; | 40 | let decl = def_map[self.id.module_id].declaration?; |
41 | let ast = decl.to_node(db); | 41 | let ast = decl.to_node(db); |
42 | Some(Source { file_id: decl.file_id(), ast }) | 42 | Some(Source { file_id: decl.file_id(), ast }) |