From 78111620a33c57b58b07ebf044a7d53dc56176ef Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Thu, 26 Dec 2019 16:22:15 +0100 Subject: Remove visibility query, instead add struct field visibility to data Methods should be handled the same, and for items the visibility will be in the def map. --- crates/ra_hir/src/code_model.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index fdf316745..9612c86da 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -257,8 +257,8 @@ impl StructField { impl HasVisibility for StructField { fn visibility(&self, db: &impl HirDatabase) -> Visibility { - let struct_field_id: hir_def::StructFieldId = (*self).into(); - let visibility = db.visibility(struct_field_id.into()); + let variant_data = self.parent.variant_data(db); + let visibility = &variant_data.fields()[self.id].visibility; let parent_id: hir_def::VariantId = self.parent.into(); visibility.resolve(db, &parent_id.resolver(db)) } -- cgit v1.2.3