diff options
Diffstat (limited to 'crates/ra_hir/src/ty/lower.rs')
-rw-r--r-- | crates/ra_hir/src/ty/lower.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/crates/ra_hir/src/ty/lower.rs b/crates/ra_hir/src/ty/lower.rs index 1c0f71adc..d33b50794 100644 --- a/crates/ra_hir/src/ty/lower.rs +++ b/crates/ra_hir/src/ty/lower.rs | |||
@@ -28,7 +28,7 @@ use crate::{ | |||
28 | db::HirDatabase, | 28 | db::HirDatabase, |
29 | ty::{ | 29 | ty::{ |
30 | primitive::{FloatTy, IntTy}, | 30 | primitive::{FloatTy, IntTy}, |
31 | utils::{all_super_traits, associated_type_by_name_including_super_traits}, | 31 | utils::{all_super_traits, associated_type_by_name_including_super_traits, variant_data}, |
32 | }, | 32 | }, |
33 | util::make_mut_slice, | 33 | util::make_mut_slice, |
34 | Adt, Const, Enum, EnumVariant, Function, ImplBlock, ModuleDef, Path, Static, Struct, Trait, | 34 | Adt, Const, Enum, EnumVariant, Function, ImplBlock, ModuleDef, Path, Static, Struct, Trait, |
@@ -514,13 +514,11 @@ pub(crate) fn field_types_query( | |||
514 | db: &impl HirDatabase, | 514 | db: &impl HirDatabase, |
515 | variant_id: VariantId, | 515 | variant_id: VariantId, |
516 | ) -> Arc<ArenaMap<LocalStructFieldId, Ty>> { | 516 | ) -> Arc<ArenaMap<LocalStructFieldId, Ty>> { |
517 | let (resolver, var_data) = match variant_id { | 517 | let var_data = variant_data(db, variant_id); |
518 | VariantId::StructId(it) => (it.resolver(db), db.struct_data(it).variant_data.clone()), | 518 | let resolver = match variant_id { |
519 | VariantId::UnionId(it) => (it.resolver(db), db.union_data(it).variant_data.clone()), | 519 | VariantId::StructId(it) => it.resolver(db), |
520 | VariantId::EnumVariantId(it) => ( | 520 | VariantId::UnionId(it) => it.resolver(db), |
521 | it.parent.resolver(db), | 521 | VariantId::EnumVariantId(it) => it.parent.resolver(db), |
522 | db.enum_data(it.parent).variants[it.local_id].variant_data.clone(), | ||
523 | ), | ||
524 | }; | 522 | }; |
525 | let mut res = ArenaMap::default(); | 523 | let mut res = ArenaMap::default(); |
526 | for (field_id, field_data) in var_data.fields().iter() { | 524 | for (field_id, field_data) in var_data.fields().iter() { |