diff options
author | Aleksey Kladov <[email protected]> | 2019-11-25 14:34:15 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-25 14:50:49 +0000 |
commit | 1455663ea15ecbfbe87b4b5be6919aa35dd0b260 (patch) | |
tree | d051e9bb71631cca33a1b4c23bf3f2576d1c0f56 /crates/ra_hir_def/src | |
parent | 5fd68b592938b6a4c074146c1b22ea0f6908fe26 (diff) |
Fixme for union fields
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r-- | crates/ra_hir_def/src/adt.rs | 5 | ||||
-rw-r--r-- | crates/ra_hir_def/src/lib.rs | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/crates/ra_hir_def/src/adt.rs b/crates/ra_hir_def/src/adt.rs index 71014826e..0091bfbc3 100644 --- a/crates/ra_hir_def/src/adt.rs +++ b/crates/ra_hir_def/src/adt.rs | |||
@@ -150,6 +150,11 @@ impl HasChildSource for VariantId { | |||
150 | src.map(|map| map[it.local_id].kind()) | 150 | src.map(|map| map[it.local_id].kind()) |
151 | } | 151 | } |
152 | VariantId::StructId(it) => it.source(db).map(|it| it.kind()), | 152 | VariantId::StructId(it) => it.source(db).map(|it| it.kind()), |
153 | VariantId::UnionId(it) => it.source(db).map(|it| { | ||
154 | it.record_field_def_list() | ||
155 | .map(ast::StructKind::Record) | ||
156 | .unwrap_or(ast::StructKind::Unit) | ||
157 | }), | ||
153 | }; | 158 | }; |
154 | let mut trace = Trace::new_for_map(); | 159 | let mut trace = Trace::new_for_map(); |
155 | lower_struct(&mut trace, &src.value); | 160 | lower_struct(&mut trace, &src.value); |
diff --git a/crates/ra_hir_def/src/lib.rs b/crates/ra_hir_def/src/lib.rs index 5f11be114..a88a78b38 100644 --- a/crates/ra_hir_def/src/lib.rs +++ b/crates/ra_hir_def/src/lib.rs | |||
@@ -431,6 +431,7 @@ impl_froms!( | |||
431 | pub enum VariantId { | 431 | pub enum VariantId { |
432 | EnumVariantId(EnumVariantId), | 432 | EnumVariantId(EnumVariantId), |
433 | StructId(StructId), | 433 | StructId(StructId), |
434 | UnionId(UnionId), | ||
434 | } | 435 | } |
435 | impl_froms!(VariantId: EnumVariantId, StructId); | 436 | impl_froms!(VariantId: EnumVariantId, StructId); |
436 | 437 | ||