diff options
Diffstat (limited to 'crates/ra_hir/src/ids.rs')
-rw-r--r-- | crates/ra_hir/src/ids.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs index 4c7ebe3ea..66adacc7d 100644 --- a/crates/ra_hir/src/ids.rs +++ b/crates/ra_hir/src/ids.rs | |||
@@ -1,10 +1,8 @@ | |||
1 | use ra_db::{SourceRootId, LocationIntener, Cancelable, FileId}; | 1 | use ra_db::{SourceRootId, LocationIntener, Cancelable, FileId}; |
2 | use ra_syntax::{SourceFileNode, SyntaxKind, SyntaxNode, SyntaxNodeRef, SourceFile, AstNode, ast}; | 2 | use ra_syntax::{SourceFileNode, SyntaxKind, SyntaxNode, SyntaxNodeRef, SourceFile, AstNode, ast}; |
3 | use ra_arena::{Arena, RawId, impl_arena_id}; | ||
3 | 4 | ||
4 | use crate::{ | 5 | use crate::{HirDatabase, PerNs, ModuleId, Module, Def, Function, Struct, Enum}; |
5 | HirDatabase, PerNs, ModuleId, Module, Def, Function, Struct, Enum, | ||
6 | arena::{Arena, Id}, | ||
7 | }; | ||
8 | 6 | ||
9 | /// hir makes a heavy use of ids: integer (u32) handlers to various things. You | 7 | /// hir makes a heavy use of ids: integer (u32) handlers to various things. You |
10 | /// can think of id as a pointer (but without a lifetime) or a file descriptor | 8 | /// can think of id as a pointer (but without a lifetime) or a file descriptor |
@@ -206,7 +204,9 @@ impl DefKind { | |||
206 | 204 | ||
207 | /// Identifier of item within a specific file. This is stable over reparses, so | 205 | /// Identifier of item within a specific file. This is stable over reparses, so |
208 | /// it's OK to use it as a salsa key/value. | 206 | /// it's OK to use it as a salsa key/value. |
209 | pub(crate) type SourceFileItemId = Id<SyntaxNode>; | 207 | #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] |
208 | pub struct SourceFileItemId(RawId); | ||
209 | impl_arena_id!(SourceFileItemId); | ||
210 | 210 | ||
211 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 211 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
212 | pub struct SourceItemId { | 212 | pub struct SourceItemId { |
@@ -219,7 +219,7 @@ pub struct SourceItemId { | |||
219 | #[derive(Debug, PartialEq, Eq)] | 219 | #[derive(Debug, PartialEq, Eq)] |
220 | pub struct SourceFileItems { | 220 | pub struct SourceFileItems { |
221 | file_id: HirFileId, | 221 | file_id: HirFileId, |
222 | arena: Arena<SyntaxNode>, | 222 | arena: Arena<SourceFileItemId, SyntaxNode>, |
223 | } | 223 | } |
224 | 224 | ||
225 | impl SourceFileItems { | 225 | impl SourceFileItems { |