aboutsummaryrefslogtreecommitdiff
path: root/crates/hir/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir/src')
-rw-r--r--crates/hir/src/code_model.rs2
-rw-r--r--crates/hir/src/semantics/source_to_def.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs
index 42dc35b76..9bfcd215a 100644
--- a/crates/hir/src/code_model.rs
+++ b/crates/hir/src/code_model.rs
@@ -970,7 +970,7 @@ impl MacroDef {
970 /// defines this macro. The reasons for this is that macros are expanded 970 /// defines this macro. The reasons for this is that macros are expanded
971 /// early, in `hir_expand`, where modules simply do not exist yet. 971 /// early, in `hir_expand`, where modules simply do not exist yet.
972 pub fn module(self, db: &dyn HirDatabase) -> Option<Module> { 972 pub fn module(self, db: &dyn HirDatabase) -> Option<Module> {
973 let krate = self.id.krate?; 973 let krate = self.id.krate;
974 let module_id = db.crate_def_map(krate).root; 974 let module_id = db.crate_def_map(krate).root;
975 Some(Module::new(Crate { id: krate }, module_id)) 975 Some(Module::new(Crate { id: krate }, module_id))
976 } 976 }
diff --git a/crates/hir/src/semantics/source_to_def.rs b/crates/hir/src/semantics/source_to_def.rs
index d499ae340..3efca5baa 100644
--- a/crates/hir/src/semantics/source_to_def.rs
+++ b/crates/hir/src/semantics/source_to_def.rs
@@ -158,7 +158,7 @@ impl SourceToDefCtx<'_, '_> {
158 let krate = self.file_to_def(file_id)?.krate; 158 let krate = self.file_to_def(file_id)?.krate;
159 let file_ast_id = self.db.ast_id_map(src.file_id).ast_id(&src.value); 159 let file_ast_id = self.db.ast_id_map(src.file_id).ast_id(&src.value);
160 let ast_id = Some(AstId::new(src.file_id, file_ast_id.upcast())); 160 let ast_id = Some(AstId::new(src.file_id, file_ast_id.upcast()));
161 Some(MacroDefId { krate: Some(krate), ast_id, kind, local_inner: false }) 161 Some(MacroDefId { krate, ast_id, kind, local_inner: false })
162 } 162 }
163 163
164 pub(super) fn find_container(&mut self, src: InFile<&SyntaxNode>) -> Option<ChildContainer> { 164 pub(super) fn find_container(&mut self, src: InFile<&SyntaxNode>) -> Option<ChildContainer> {