diff options
author | Florian Diebold <[email protected]> | 2019-12-26 15:22:15 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-12-26 15:23:40 +0000 |
commit | 78111620a33c57b58b07ebf044a7d53dc56176ef (patch) | |
tree | 8d5d2f89db0db56f8abfbda59b4391a7b0dff9db /crates/ra_hir | |
parent | 50ebff257dafe6e820f002241466ff4a98aa1f32 (diff) |
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.
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 4 |
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 | ||
258 | impl HasVisibility for StructField { | 258 | impl 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 | } |