aboutsummaryrefslogtreecommitdiff
path: root/crates/hir/src/code_model.rs
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2020-12-15 19:33:05 +0000
committerJonas Schievink <[email protected]>2020-12-15 19:33:05 +0000
commitb238ddd21adf9910769522a21e31c2e14f664396 (patch)
tree219749056bcef5cd35cfc94826108c4f955b1c8b /crates/hir/src/code_model.rs
parentc31c3246a8c87a3639623c30b692a57e728bb046 (diff)
Make macro def krate mandatory
Refactors builtin derive support to go through proper name resolution
Diffstat (limited to 'crates/hir/src/code_model.rs')
-rw-r--r--crates/hir/src/code_model.rs2
1 files changed, 1 insertions, 1 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 }