diff options
author | Edwin Cheng <[email protected]> | 2020-05-04 18:15:27 +0100 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2020-05-04 18:15:27 +0100 |
commit | e921195d93c443b20a6fcb3cb1c5b8117fe2fa1b (patch) | |
tree | 2023a2b1f5b2fc037a42c2cf850d6e1b41b65446 /crates/ra_hir_def/src/nameres | |
parent | 5ae18f4f814501ccd96a277c320e919159c91fac (diff) |
Change favor_types to has_constructor
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 | } |