aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast/traits.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/ast/traits.rs')
-rw-r--r--crates/ra_syntax/src/ast/traits.rs10
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 @@
5use itertools::Itertools; 5use itertools::Itertools;
6 6
7use crate::{ 7use 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
36pub trait ArgListOwner: AstNode { 40pub 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
70pub trait AttrsOwner: AstNode { 78pub trait AttrsOwner: AstNode {