diff options
Diffstat (limited to 'crates/ra_hir_def/src/nameres')
-rw-r--r-- | crates/ra_hir_def/src/nameres/collector.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index 49b33ca94..db994122a 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs | |||
@@ -844,7 +844,7 @@ impl ModCollector<'_, '_> { | |||
844 | let name = def.name.clone(); | 844 | let name = def.name.clone(); |
845 | let container = ContainerId::ModuleId(module); | 845 | let container = ContainerId::ModuleId(module); |
846 | let vis = &def.visibility; | 846 | let vis = &def.visibility; |
847 | let mut favor_types = false; | 847 | let mut has_constructor = false; |
848 | 848 | ||
849 | let def: ModuleDefId = match def.kind { | 849 | let def: ModuleDefId = match def.kind { |
850 | raw::DefKind::Function(ast_id) => FunctionLoc { | 850 | raw::DefKind::Function(ast_id) => FunctionLoc { |
@@ -854,7 +854,7 @@ impl ModCollector<'_, '_> { | |||
854 | .intern(self.def_collector.db) | 854 | .intern(self.def_collector.db) |
855 | .into(), | 855 | .into(), |
856 | raw::DefKind::Struct(ast_id, mode) => { | 856 | raw::DefKind::Struct(ast_id, mode) => { |
857 | favor_types = mode == raw::StructDefKind::Record; | 857 | has_constructor = mode != raw::StructDefKind::Record; |
858 | StructLoc { container, ast_id: AstId::new(self.file_id, ast_id) } | 858 | StructLoc { container, ast_id: AstId::new(self.file_id, ast_id) } |
859 | .intern(self.def_collector.db) | 859 | .intern(self.def_collector.db) |
860 | .into() | 860 | .into() |
@@ -899,7 +899,7 @@ impl ModCollector<'_, '_> { | |||
899 | .unwrap_or(Visibility::Public); | 899 | .unwrap_or(Visibility::Public); |
900 | self.def_collector.update( | 900 | self.def_collector.update( |
901 | self.module_id, | 901 | self.module_id, |
902 | &[(name, PerNs::from_def(def, vis, favor_types))], | 902 | &[(name, PerNs::from_def(def, vis, has_constructor))], |
903 | vis, | 903 | vis, |
904 | ) | 904 | ) |
905 | } | 905 | } |