diff options
Diffstat (limited to 'crates/ra_hir_def/src/body')
-rw-r--r-- | crates/ra_hir_def/src/body/lower.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 8f5fa1b55..443b057ab 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -573,9 +573,16 @@ impl ExprCollector<'_> { | |||
573 | self.body.item_scope.define_def(def); | 573 | self.body.item_scope.define_def(def); |
574 | if let Some(name) = name { | 574 | if let Some(name) = name { |
575 | let vis = crate::visibility::Visibility::Public; // FIXME determine correctly | 575 | let vis = crate::visibility::Visibility::Public; // FIXME determine correctly |
576 | self.body | 576 | let has_constructor = match def { |
577 | .item_scope | 577 | ModuleDefId::AdtId(AdtId::StructId(s)) => { |
578 | .push_res(name.as_name(), crate::per_ns::PerNs::from_def(def, vis)); | 578 | self.db.struct_data(s).variant_data.kind() != StructKind::Record |
579 | } | ||
580 | _ => true, | ||
581 | }; | ||
582 | self.body.item_scope.push_res( | ||
583 | name.as_name(), | ||
584 | crate::per_ns::PerNs::from_def(def, vis, has_constructor), | ||
585 | ); | ||
579 | } | 586 | } |
580 | } | 587 | } |
581 | } | 588 | } |