mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
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.
This commit is contained in:
parent
50ebff257d
commit
78111620a3
5 changed files with 35 additions and 102 deletions
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue