From 09f9733ca67b74057c55b6e96f38223a73db6a6e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 31 Oct 2019 16:40:36 +0300 Subject: move struct & enum data to hir_def --- crates/ra_hir_def/src/lib.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'crates/ra_hir_def/src/lib.rs') diff --git a/crates/ra_hir_def/src/lib.rs b/crates/ra_hir_def/src/lib.rs index 93ad40005..76d5f1852 100644 --- a/crates/ra_hir_def/src/lib.rs +++ b/crates/ra_hir_def/src/lib.rs @@ -12,6 +12,7 @@ pub mod attr; pub mod path; pub mod type_ref; pub mod builtin_type; +pub mod adt; // FIXME: this should be private pub mod nameres; @@ -259,6 +260,22 @@ 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 { + parent: VariantId, + local_id: LocalStructFieldId, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub struct LocalStructFieldId(RawId); +impl_arena_id!(LocalStructFieldId); + #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct ConstId(salsa::InternId); impl_intern_key!(ConstId); -- cgit v1.2.3