mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 14:51:48 +00:00
add ModuleDefId to hir_def
This commit is contained in:
parent
7973c91281
commit
1602db7d7d
3 changed files with 61 additions and 11 deletions
|
@ -3,7 +3,7 @@
|
|||
|
||||
use std::sync::Arc;
|
||||
|
||||
use hir_def::type_ref::TypeRef;
|
||||
use hir_def::{type_ref::TypeRef, LocalEnumVariantId};
|
||||
use hir_expand::name::AsName;
|
||||
use ra_arena::{impl_arena_id, Arena, RawId};
|
||||
use ra_syntax::ast::{self, NameOwner, StructKind, TypeAscriptionOwner};
|
||||
|
@ -68,7 +68,7 @@ impl EnumVariant {
|
|||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct EnumData {
|
||||
pub(crate) name: Option<Name>,
|
||||
pub(crate) variants: Arena<EnumVariantId, EnumVariantData>,
|
||||
pub(crate) variants: Arena<LocalEnumVariantId, EnumVariantData>,
|
||||
}
|
||||
|
||||
impl EnumData {
|
||||
|
@ -85,10 +85,6 @@ impl EnumData {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub(crate) struct EnumVariantId(RawId);
|
||||
impl_arena_id!(EnumVariantId);
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub(crate) struct EnumVariantData {
|
||||
pub(crate) name: Option<Name>,
|
||||
|
|
|
@ -8,14 +8,14 @@ use std::sync::Arc;
|
|||
use hir_def::{
|
||||
builtin_type::BuiltinType,
|
||||
type_ref::{Mutability, TypeRef},
|
||||
CrateModuleId, ModuleId,
|
||||
CrateModuleId, LocalEnumVariantId, ModuleId,
|
||||
};
|
||||
use hir_expand::name::{self, AsName};
|
||||
use ra_db::{CrateId, Edition};
|
||||
use ra_syntax::ast::{self, NameOwner, TypeAscriptionOwner};
|
||||
|
||||
use crate::{
|
||||
adt::{EnumVariantId, StructFieldId, VariantDef},
|
||||
adt::{StructFieldId, VariantDef},
|
||||
db::{AstDatabase, DefDatabase, HirDatabase},
|
||||
diagnostics::DiagnosticSink,
|
||||
expr::{validation::ExprValidator, Body, BodySourceMap},
|
||||
|
@ -410,7 +410,7 @@ impl Enum {
|
|||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub struct EnumVariant {
|
||||
pub(crate) parent: Enum,
|
||||
pub(crate) id: EnumVariantId,
|
||||
pub(crate) id: LocalEnumVariantId,
|
||||
}
|
||||
|
||||
impl EnumVariant {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue