aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/body/lower.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/body/lower.rs')
-rw-r--r--crates/ra_hir_def/src/body/lower.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs
index ea0ddeebc..4671b72e9 100644
--- a/crates/ra_hir_def/src/body/lower.rs
+++ b/crates/ra_hir_def/src/body/lower.rs
@@ -575,15 +575,15 @@ impl ExprCollector<'_> {
575 self.body.item_scope.define_def(def); 575 self.body.item_scope.define_def(def);
576 if let Some(name) = name { 576 if let Some(name) = name {
577 let vis = crate::visibility::Visibility::Public; // FIXME determine correctly 577 let vis = crate::visibility::Visibility::Public; // FIXME determine correctly
578 let favor_types = match def { 578 let has_constructor = match def {
579 ModuleDefId::AdtId(AdtId::StructId(s)) => { 579 ModuleDefId::AdtId(AdtId::StructId(s)) => {
580 self.db.struct_data(s).variant_data.kind() == StructKind::Record 580 self.db.struct_data(s).variant_data.kind() != StructKind::Record
581 } 581 }
582 _ => false, 582 _ => true,
583 }; 583 };
584 self.body.item_scope.push_res( 584 self.body.item_scope.push_res(
585 name.as_name(), 585 name.as_name(),
586 crate::per_ns::PerNs::from_def(def, vis, favor_types), 586 crate::per_ns::PerNs::from_def(def, vis, has_constructor),
587 ); 587 );
588 } 588 }
589 } 589 }