From d06904e90cdc1603ffcb714e70dab83905221f72 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 24 Nov 2019 23:48:39 +0300 Subject: Switch to variant-granularity field type inference --- crates/ra_hir_def/src/lib.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'crates/ra_hir_def/src') 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 @@ -191,12 +191,6 @@ pub struct EnumVariantId { pub struct LocalEnumVariantId(RawId); impl_arena_id!(LocalEnumVariantId); -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub enum VariantId { - EnumVariantId(EnumVariantId), - StructId(StructId), -} - #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct StructFieldId { pub parent: VariantId, @@ -437,6 +431,13 @@ impl_froms!( ImplId ); +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub enum VariantId { + EnumVariantId(EnumVariantId), + StructId(StructId), +} +impl_froms!(VariantId: EnumVariantId, StructId); + trait Intern { type ID; fn intern(self, db: &impl db::DefDatabase) -> Self::ID; -- cgit v1.2.3