aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/code_model.rs4
1 files changed, 2 insertions, 2 deletions
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 {
257 257
258impl HasVisibility for StructField { 258impl HasVisibility for StructField {
259 fn visibility(&self, db: &impl HirDatabase) -> Visibility { 259 fn visibility(&self, db: &impl HirDatabase) -> Visibility {
260 let struct_field_id: hir_def::StructFieldId = (*self).into(); 260 let variant_data = self.parent.variant_data(db);
261 let visibility = db.visibility(struct_field_id.into()); 261 let visibility = &variant_data.fields()[self.id].visibility;
262 let parent_id: hir_def::VariantId = self.parent.into(); 262 let parent_id: hir_def::VariantId = self.parent.into();
263 visibility.resolve(db, &parent_id.resolver(db)) 263 visibility.resolve(db, &parent_id.resolver(db))
264 } 264 }