diff options
Diffstat (limited to 'crates/ra_syntax/src/ast/traits.rs')
-rw-r--r-- | crates/ra_syntax/src/ast/traits.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/crates/ra_syntax/src/ast/traits.rs b/crates/ra_syntax/src/ast/traits.rs index 576378306..870e83804 100644 --- a/crates/ra_syntax/src/ast/traits.rs +++ b/crates/ra_syntax/src/ast/traits.rs | |||
@@ -5,7 +5,7 @@ | |||
5 | use itertools::Itertools; | 5 | use itertools::Itertools; |
6 | 6 | ||
7 | use crate::{ | 7 | use crate::{ |
8 | ast::{self, child_opt, children, AstChildren, AstNode, AstToken}, | 8 | ast::{self, child_opt, children, support, AstChildren, AstNode, AstToken}, |
9 | syntax_node::SyntaxElementChildren, | 9 | syntax_node::SyntaxElementChildren, |
10 | }; | 10 | }; |
11 | 11 | ||
@@ -31,6 +31,10 @@ pub trait LoopBodyOwner: AstNode { | |||
31 | fn loop_body(&self) -> Option<ast::BlockExpr> { | 31 | fn loop_body(&self) -> Option<ast::BlockExpr> { |
32 | child_opt(self) | 32 | child_opt(self) |
33 | } | 33 | } |
34 | |||
35 | fn label(&self) -> Option<ast::Label> { | ||
36 | child_opt(self) | ||
37 | } | ||
34 | } | 38 | } |
35 | 39 | ||
36 | pub trait ArgListOwner: AstNode { | 40 | pub trait ArgListOwner: AstNode { |
@@ -65,6 +69,10 @@ pub trait TypeBoundsOwner: AstNode { | |||
65 | fn type_bound_list(&self) -> Option<ast::TypeBoundList> { | 69 | fn type_bound_list(&self) -> Option<ast::TypeBoundList> { |
66 | child_opt(self) | 70 | child_opt(self) |
67 | } | 71 | } |
72 | |||
73 | fn colon(&self) -> Option<ast::Colon> { | ||
74 | support::token(self.syntax()) | ||
75 | } | ||
68 | } | 76 | } |
69 | 77 | ||
70 | pub trait AttrsOwner: AstNode { | 78 | pub trait AttrsOwner: AstNode { |