Skip to content

Commit e7f5681

Browse files
committed
ast: Add Expr::Kind::Try
gcc/rust/ChangeLog: * ast/rust-ast.h: Add the new variant. * ast/rust-expr.h: Use it for TryExpr class.
1 parent 441d781 commit e7f5681

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

gcc/rust/ast/rust-ast.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,6 +1318,7 @@ class Expr : public Visitable
13181318
TypeCast,
13191319
Assignment,
13201320
CompoundAssignment,
1321+
Try,
13211322
};
13221323

13231324
virtual Kind get_expr_kind () const = 0;

gcc/rust/ast/rust-expr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3792,7 +3792,7 @@ class TryExpr : public ExprWithBlock
37923792
outer_attrs = std::move (new_attrs);
37933793
}
37943794

3795-
Expr::Kind get_expr_kind () const override { return Expr::Kind::Return; }
3795+
Expr::Kind get_expr_kind () const override { return Expr::Kind::Try; }
37963796

37973797
protected:
37983798
/* Use covariance to implement clone function as returning this object rather

0 commit comments

Comments
 (0)