diff options
Diffstat (limited to 'crates/ra_syntax/src/ast.rs')
-rw-r--r-- | crates/ra_syntax/src/ast.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index fd65264b2..165b308d1 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs | |||
@@ -15,12 +15,13 @@ use crate::{ | |||
15 | /// conversion itself has zero runtime cost: ast and syntax nodes have exactly | 15 | /// conversion itself has zero runtime cost: ast and syntax nodes have exactly |
16 | /// the same representation: a pointer to the tree root and a pointer to the | 16 | /// the same representation: a pointer to the tree root and a pointer to the |
17 | /// node itself. | 17 | /// node itself. |
18 | pub trait AstNode: rowan::TransparentNewType<Repr = rowan::SyntaxNode<RaTypes>> { | 18 | pub trait AstNode: |
19 | rowan::TransparentNewType<Repr = rowan::SyntaxNode<RaTypes>> + ToOwned<Owned = TreeArc<Self>> | ||
20 | { | ||
19 | fn cast(syntax: &SyntaxNode) -> Option<&Self> | 21 | fn cast(syntax: &SyntaxNode) -> Option<&Self> |
20 | where | 22 | where |
21 | Self: Sized; | 23 | Self: Sized; |
22 | fn syntax(&self) -> &SyntaxNode; | 24 | fn syntax(&self) -> &SyntaxNode; |
23 | fn to_owned(&self) -> TreeArc<Self>; | ||
24 | } | 25 | } |
25 | 26 | ||
26 | pub trait AstToken: AstNode { | 27 | pub trait AstToken: AstNode { |