diff options
author | Aleksey Kladov <[email protected]> | 2019-11-24 20:48:39 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-24 21:12:36 +0000 |
commit | d06904e90cdc1603ffcb714e70dab83905221f72 (patch) | |
tree | edd220cc84f504072d7154994cdd56a787625b5e /crates/ra_hir_def | |
parent | f16cff3cad931d48a5516b2aec468cfddbed7dd1 (diff) |
Switch to variant-granularity field type inference
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r-- | crates/ra_hir_def/src/lib.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/crates/ra_hir_def/src/lib.rs b/crates/ra_hir_def/src/lib.rs index f63c3dd64..e9d569778 100644 --- a/crates/ra_hir_def/src/lib.rs +++ b/crates/ra_hir_def/src/lib.rs | |||
@@ -192,12 +192,6 @@ pub struct LocalEnumVariantId(RawId); | |||
192 | impl_arena_id!(LocalEnumVariantId); | 192 | impl_arena_id!(LocalEnumVariantId); |
193 | 193 | ||
194 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 194 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
195 | pub enum VariantId { | ||
196 | EnumVariantId(EnumVariantId), | ||
197 | StructId(StructId), | ||
198 | } | ||
199 | |||
200 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | ||
201 | pub struct StructFieldId { | 195 | pub struct StructFieldId { |
202 | pub parent: VariantId, | 196 | pub parent: VariantId, |
203 | pub local_id: LocalStructFieldId, | 197 | pub local_id: LocalStructFieldId, |
@@ -437,6 +431,13 @@ impl_froms!( | |||
437 | ImplId | 431 | ImplId |
438 | ); | 432 | ); |
439 | 433 | ||
434 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | ||
435 | pub enum VariantId { | ||
436 | EnumVariantId(EnumVariantId), | ||
437 | StructId(StructId), | ||
438 | } | ||
439 | impl_froms!(VariantId: EnumVariantId, StructId); | ||
440 | |||
440 | trait Intern { | 441 | trait Intern { |
441 | type ID; | 442 | type ID; |
442 | fn intern(self, db: &impl db::DefDatabase) -> Self::ID; | 443 | fn intern(self, db: &impl db::DefDatabase) -> Self::ID; |