diff options
Diffstat (limited to 'crates/ra_hir_def/src/nameres')
-rw-r--r-- | crates/ra_hir_def/src/nameres/collector.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index d4bfcae1d..6f4a3e42e 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs | |||
@@ -19,7 +19,7 @@ use crate::{ | |||
19 | db::DefDatabase, | 19 | db::DefDatabase, |
20 | nameres::{ | 20 | nameres::{ |
21 | diagnostics::DefDiagnostic, mod_resolution::ModDir, path_resolution::ReachedFixedPoint, | 21 | diagnostics::DefDiagnostic, mod_resolution::ModDir, path_resolution::ReachedFixedPoint, |
22 | raw, BuiltinShadowMode, CrateDefMap, ModuleData, Resolution, ResolveMode, | 22 | raw, BuiltinShadowMode, CrateDefMap, ModuleData, ModuleOrigin, Resolution, ResolveMode, |
23 | }, | 23 | }, |
24 | path::{Path, PathKind}, | 24 | path::{Path, PathKind}, |
25 | per_ns::PerNs, | 25 | per_ns::PerNs, |
@@ -131,7 +131,7 @@ where | |||
131 | let file_id = crate_graph.crate_root(self.def_map.krate); | 131 | let file_id = crate_graph.crate_root(self.def_map.krate); |
132 | let raw_items = self.db.raw_items(file_id.into()); | 132 | let raw_items = self.db.raw_items(file_id.into()); |
133 | let module_id = self.def_map.root; | 133 | let module_id = self.def_map.root; |
134 | self.def_map.modules[module_id].definition = Some(file_id); | 134 | self.def_map.modules[module_id].origin = ModuleOrigin::root(file_id); |
135 | ModCollector { | 135 | ModCollector { |
136 | def_collector: &mut *self, | 136 | def_collector: &mut *self, |
137 | module_id, | 137 | module_id, |
@@ -669,8 +669,7 @@ where | |||
669 | let modules = &mut self.def_collector.def_map.modules; | 669 | let modules = &mut self.def_collector.def_map.modules; |
670 | let res = modules.alloc(ModuleData::default()); | 670 | let res = modules.alloc(ModuleData::default()); |
671 | modules[res].parent = Some(self.module_id); | 671 | modules[res].parent = Some(self.module_id); |
672 | modules[res].declaration = Some(declaration); | 672 | modules[res].origin = ModuleOrigin::not_sure_file(definition, declaration); |
673 | modules[res].definition = definition; | ||
674 | modules[res].scope.legacy_macros = modules[self.module_id].scope.legacy_macros.clone(); | 673 | modules[res].scope.legacy_macros = modules[self.module_id].scope.legacy_macros.clone(); |
675 | modules[self.module_id].children.insert(name.clone(), res); | 674 | modules[self.module_id].children.insert(name.clone(), res); |
676 | let resolution = Resolution { | 675 | let resolution = Resolution { |