diff options
author | Jonas Schievink <[email protected]> | 2021-04-06 16:59:18 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-04-06 16:59:18 +0100 |
commit | e9752308bbaa2fd720e1eeaca970977fe22514d1 (patch) | |
tree | b391af28f6bfaee53effcc64aeab325e95b5b461 /crates/hir_def/src | |
parent | 74711deb724e0a6c84a221bfdfa15eaedbdb2300 (diff) |
infer: remove `record_field_resolutions` field
It stores no useful data, since we can derive all fields from
`variant_resolutions`
Diffstat (limited to 'crates/hir_def/src')
-rw-r--r-- | crates/hir_def/src/lib.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crates/hir_def/src/lib.rs b/crates/hir_def/src/lib.rs index be9a5e1a0..abd6c553f 100644 --- a/crates/hir_def/src/lib.rs +++ b/crates/hir_def/src/lib.rs | |||
@@ -56,6 +56,7 @@ use std::{ | |||
56 | sync::Arc, | 56 | sync::Arc, |
57 | }; | 57 | }; |
58 | 58 | ||
59 | use adt::VariantData; | ||
59 | use base_db::{impl_intern_key, salsa, CrateId}; | 60 | use base_db::{impl_intern_key, salsa, CrateId}; |
60 | use hir_expand::{ | 61 | use hir_expand::{ |
61 | ast_id_map::FileAstId, | 62 | ast_id_map::FileAstId, |
@@ -442,6 +443,18 @@ pub enum VariantId { | |||
442 | } | 443 | } |
443 | impl_from!(EnumVariantId, StructId, UnionId for VariantId); | 444 | impl_from!(EnumVariantId, StructId, UnionId for VariantId); |
444 | 445 | ||
446 | impl VariantId { | ||
447 | pub fn variant_data(self, db: &dyn db::DefDatabase) -> Arc<VariantData> { | ||
448 | match self { | ||
449 | VariantId::StructId(it) => db.struct_data(it).variant_data.clone(), | ||
450 | VariantId::UnionId(it) => db.union_data(it).variant_data.clone(), | ||
451 | VariantId::EnumVariantId(it) => { | ||
452 | db.enum_data(it.parent).variants[it.local_id].variant_data.clone() | ||
453 | } | ||
454 | } | ||
455 | } | ||
456 | } | ||
457 | |||
445 | trait Intern { | 458 | trait Intern { |
446 | type ID; | 459 | type ID; |
447 | fn intern(self, db: &dyn db::DefDatabase) -> Self::ID; | 460 | fn intern(self, db: &dyn db::DefDatabase) -> Self::ID; |