diff options
Diffstat (limited to 'crates/libsyntax2/src/yellow/syntax.rs')
-rw-r--r-- | crates/libsyntax2/src/yellow/syntax.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/crates/libsyntax2/src/yellow/syntax.rs b/crates/libsyntax2/src/yellow/syntax.rs index 0045598d4..75b6cb7dc 100644 --- a/crates/libsyntax2/src/yellow/syntax.rs +++ b/crates/libsyntax2/src/yellow/syntax.rs | |||
@@ -1,4 +1,7 @@ | |||
1 | use std::{fmt, sync::Arc}; | 1 | use std::{ |
2 | fmt, sync::Arc, | ||
3 | hash::{Hasher, Hash}, | ||
4 | }; | ||
2 | 5 | ||
3 | use smol_str::SmolStr; | 6 | use smol_str::SmolStr; |
4 | 7 | ||
@@ -27,6 +30,11 @@ impl<R1: TreeRoot, R2: TreeRoot> PartialEq<SyntaxNode<R1>> for SyntaxNode<R2> { | |||
27 | } | 30 | } |
28 | 31 | ||
29 | impl<R: TreeRoot> Eq for SyntaxNode<R> {} | 32 | impl<R: TreeRoot> Eq for SyntaxNode<R> {} |
33 | impl<R: TreeRoot> Hash for SyntaxNode<R> { | ||
34 | fn hash<H: Hasher>(&self, state: &mut H) { | ||
35 | self.red.hash(state) | ||
36 | } | ||
37 | } | ||
30 | 38 | ||
31 | pub type SyntaxNodeRef<'a> = SyntaxNode<RefRoot<'a>>; | 39 | pub type SyntaxNodeRef<'a> = SyntaxNode<RefRoot<'a>>; |
32 | 40 | ||