strongy-typed ids for macros

This commit is contained in:
Aleksey Kladov 2019-03-26 18:03:17 +03:00
parent fb8b354dcc
commit 071a19537d
4 changed files with 19 additions and 33 deletions

View file

@ -5,7 +5,7 @@ use ra_syntax::{SyntaxNodePtr, TreeArc, SyntaxNode, SourceFile, AstNode, ast};
use crate::{HirFileId, DefDatabase};
#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Hash)]
pub(crate) struct AstId<N: AstNode> {
file_id: HirFileId,
file_ast_id: FileAstId<N>,
@ -30,7 +30,7 @@ impl<N: AstNode> AstId<N> {
}
}
#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Hash)]
pub(crate) struct FileAstId<N: AstNode> {
raw: SourceFileItemId,
_ty: PhantomData<N>,