From e921195d93c443b20a6fcb3cb1c5b8117fe2fa1b Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Tue, 5 May 2020 01:15:27 +0800 Subject: Change favor_types to has_constructor --- crates/ra_hir_def/src/nameres/collector.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir_def/src/nameres') 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<'_, '_> { let name = def.name.clone(); let container = ContainerId::ModuleId(module); let vis = &def.visibility; - let mut favor_types = false; + let mut has_constructor = false; let def: ModuleDefId = match def.kind { raw::DefKind::Function(ast_id) => FunctionLoc { @@ -854,7 +854,7 @@ impl ModCollector<'_, '_> { .intern(self.def_collector.db) .into(), raw::DefKind::Struct(ast_id, mode) => { - favor_types = mode == raw::StructDefKind::Record; + has_constructor = mode != raw::StructDefKind::Record; StructLoc { container, ast_id: AstId::new(self.file_id, ast_id) } .intern(self.def_collector.db) .into() @@ -899,7 +899,7 @@ impl ModCollector<'_, '_> { .unwrap_or(Visibility::Public); self.def_collector.update( self.module_id, - &[(name, PerNs::from_def(def, vis, favor_types))], + &[(name, PerNs::from_def(def, vis, has_constructor))], vis, ) } -- cgit v1.2.3