diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-25 14:51:17 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-25 14:51:17 +0000 |
commit | ecd1204804a2a3c8b9b98e4b9d18feef06ab51c7 (patch) | |
tree | d051e9bb71631cca33a1b4c23bf3f2576d1c0f56 /crates/ra_hir/src/ty/lower.rs | |
parent | be00d74c7b61fb82bdade482e95035a21f9dd736 (diff) | |
parent | 1455663ea15ecbfbe87b4b5be6919aa35dd0b260 (diff) |
Merge #2403
2403: Fixme for union fields r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty/lower.rs')
-rw-r--r-- | crates/ra_hir/src/ty/lower.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_hir/src/ty/lower.rs b/crates/ra_hir/src/ty/lower.rs index 27cfe00c1..eb51d31bd 100644 --- a/crates/ra_hir/src/ty/lower.rs +++ b/crates/ra_hir/src/ty/lower.rs | |||
@@ -560,7 +560,8 @@ pub(crate) fn field_types_query( | |||
560 | variant_id: VariantId, | 560 | variant_id: VariantId, |
561 | ) -> Arc<ArenaMap<LocalStructFieldId, Ty>> { | 561 | ) -> Arc<ArenaMap<LocalStructFieldId, Ty>> { |
562 | let (resolver, var_data) = match variant_id { | 562 | let (resolver, var_data) = match variant_id { |
563 | VariantId::StructId(it) => (it.resolver(db), db.struct_data(it.0).variant_data.clone()), | 563 | VariantId::StructId(it) => (it.resolver(db), db.struct_data(it).variant_data.clone()), |
564 | VariantId::UnionId(it) => (it.resolver(db), db.union_data(it).variant_data.clone()), | ||
564 | VariantId::EnumVariantId(it) => ( | 565 | VariantId::EnumVariantId(it) => ( |
565 | it.parent.resolver(db), | 566 | it.parent.resolver(db), |
566 | db.enum_data(it.parent).variants[it.local_id].variant_data.clone(), | 567 | db.enum_data(it.parent).variants[it.local_id].variant_data.clone(), |
@@ -818,7 +819,7 @@ impl CallableDef { | |||
818 | pub fn krate(self, db: &impl HirDatabase) -> CrateId { | 819 | pub fn krate(self, db: &impl HirDatabase) -> CrateId { |
819 | match self { | 820 | match self { |
820 | CallableDef::FunctionId(f) => f.lookup(db).module(db).krate, | 821 | CallableDef::FunctionId(f) => f.lookup(db).module(db).krate, |
821 | CallableDef::StructId(s) => s.0.module(db).krate, | 822 | CallableDef::StructId(s) => s.module(db).krate, |
822 | CallableDef::EnumVariantId(e) => e.parent.module(db).krate, | 823 | CallableDef::EnumVariantId(e) => e.parent.module(db).krate, |
823 | } | 824 | } |
824 | } | 825 | } |