aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/ast
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-28 19:11:17 +0100
committerAleksey Kladov <[email protected]>2018-08-28 19:11:17 +0100
commit2257c08cb159a30492bf2aec172539b1dd504700 (patch)
tree3346d52224b9444e975314e1af32f4490baf91c2 /crates/libsyntax2/src/ast
parentb00a4d43ecd4af49a2870718a9d5b8d49084a285 (diff)
Add ret type
Diffstat (limited to 'crates/libsyntax2/src/ast')
-rw-r--r--crates/libsyntax2/src/ast/generated.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs
index 999023e3d..e8743caa8 100644
--- a/crates/libsyntax2/src/ast/generated.rs
+++ b/crates/libsyntax2/src/ast/generated.rs
@@ -523,6 +523,10 @@ impl<'a> FnDef<'a> {
523 pub fn body(self) -> Option<Block<'a>> { 523 pub fn body(self) -> Option<Block<'a>> {
524 super::child_opt(self) 524 super::child_opt(self)
525 } 525 }
526
527 pub fn ret_type(self) -> Option<RetType<'a>> {
528 super::child_opt(self)
529 }
526} 530}
527 531
528// FnPointerType 532// FnPointerType
@@ -1412,6 +1416,24 @@ impl<'a> AstNode<'a> for ReferenceType<'a> {
1412 1416
1413impl<'a> ReferenceType<'a> {} 1417impl<'a> ReferenceType<'a> {}
1414 1418
1419// RetType
1420#[derive(Debug, Clone, Copy)]
1421pub struct RetType<'a> {
1422 syntax: SyntaxNodeRef<'a>,
1423}
1424
1425impl<'a> AstNode<'a> for RetType<'a> {
1426 fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> {
1427 match syntax.kind() {
1428 RET_TYPE => Some(RetType { syntax }),
1429 _ => None,
1430 }
1431 }
1432 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
1433}
1434
1435impl<'a> RetType<'a> {}
1436
1415// ReturnExpr 1437// ReturnExpr
1416#[derive(Debug, Clone, Copy)] 1438#[derive(Debug, Clone, Copy)]
1417pub struct ReturnExpr<'a> { 1439pub struct ReturnExpr<'a> {