diff options
Diffstat (limited to 'crates/ra_syntax/src/ast.rs')
-rw-r--r-- | crates/ra_syntax/src/ast.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index ceb603c50..4a38197f6 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs | |||
@@ -10,7 +10,7 @@ use std::marker::PhantomData; | |||
10 | 10 | ||
11 | use crate::{ | 11 | use crate::{ |
12 | syntax_node::{SyntaxNode, SyntaxNodeChildren, SyntaxToken}, | 12 | syntax_node::{SyntaxNode, SyntaxNodeChildren, SyntaxToken}, |
13 | SmolStr, | 13 | SmolStr, SyntaxKind, |
14 | }; | 14 | }; |
15 | 15 | ||
16 | pub use self::{ | 16 | pub use self::{ |
@@ -26,6 +26,8 @@ pub use self::{ | |||
26 | /// the same representation: a pointer to the tree root and a pointer to the | 26 | /// the same representation: a pointer to the tree root and a pointer to the |
27 | /// node itself. | 27 | /// node itself. |
28 | pub trait AstNode: Clone { | 28 | pub trait AstNode: Clone { |
29 | fn can_cast(kind: SyntaxKind) -> bool; | ||
30 | |||
29 | fn cast(syntax: SyntaxNode) -> Option<Self> | 31 | fn cast(syntax: SyntaxNode) -> Option<Self> |
30 | where | 32 | where |
31 | Self: Sized; | 33 | Self: Sized; |