aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/lib.rs')
-rw-r--r--crates/ra_hir_def/src/lib.rs33
1 files changed, 30 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/lib.rs b/crates/ra_hir_def/src/lib.rs
index 2edf743ab..1bcdf9b78 100644
--- a/crates/ra_hir_def/src/lib.rs
+++ b/crates/ra_hir_def/src/lib.rs
@@ -32,7 +32,7 @@ pub mod nameres;
32 32
33use std::hash::{Hash, Hasher}; 33use std::hash::{Hash, Hasher};
34 34
35use hir_expand::{ast_id_map::FileAstId, db::AstDatabase, AstId, HirFileId, Source}; 35use hir_expand::{ast_id_map::FileAstId, db::AstDatabase, AstId, HirFileId, MacroDefId, Source};
36use ra_arena::{impl_arena_id, map::ArenaMap, RawId}; 36use ra_arena::{impl_arena_id, map::ArenaMap, RawId};
37use ra_db::{salsa, CrateId, FileId}; 37use ra_db::{salsa, CrateId, FileId};
38use ra_syntax::{ast, AstNode, SyntaxNode}; 38use ra_syntax::{ast, AstNode, SyntaxNode};
@@ -280,8 +280,8 @@ pub enum VariantId {
280 280
281#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 281#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
282pub struct StructFieldId { 282pub struct StructFieldId {
283 parent: VariantId, 283 pub parent: VariantId,
284 local_id: LocalStructFieldId, 284 pub local_id: LocalStructFieldId,
285} 285}
286 286
287#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 287#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
@@ -477,6 +477,33 @@ impl_froms!(
477 ConstId 477 ConstId
478); 478);
479 479
480#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
481pub enum AttrDefId {
482 ModuleId(ModuleId),
483 StructFieldId(StructFieldId),
484 AdtId(AdtId),
485 FunctionId(FunctionId),
486 EnumVariantId(EnumVariantId),
487 StaticId(StaticId),
488 ConstId(ConstId),
489 TraitId(TraitId),
490 TypeAliasId(TypeAliasId),
491 MacroDefId(MacroDefId),
492}
493
494impl_froms!(
495 AttrDefId: ModuleId,
496 StructFieldId,
497 AdtId(StructId, EnumId, UnionId),
498 EnumVariantId,
499 StaticId,
500 ConstId,
501 FunctionId,
502 TraitId,
503 TypeAliasId,
504 MacroDefId
505);
506
480trait Intern { 507trait Intern {
481 type ID; 508 type ID;
482 fn intern(self, db: &impl db::DefDatabase2) -> Self::ID; 509 fn intern(self, db: &impl db::DefDatabase2) -> Self::ID;