https://gcc.gnu.org/g:ba00ed09766d9698136020418f12e59ccb656af7

commit r16-2957-gba00ed09766d9698136020418f12e59ccb656af7
Author: Arthur Cohen <arthur.co...@embecosm.com>
Date:   Tue Jul 22 13:38:26 2025 +0200

    gccrs: 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.

Diff:
---
 gcc/rust/ast/rust-ast.h  | 1 +
 gcc/rust/ast/rust-expr.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index 0d853e744c76..33c50b71d38d 100644
--- a/gcc/rust/ast/rust-ast.h
+++ b/gcc/rust/ast/rust-ast.h
@@ -1318,6 +1318,7 @@ public:
     TypeCast,
     Assignment,
     CompoundAssignment,
+    Try,
   };
 
   virtual Kind get_expr_kind () const = 0;
diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h
index 8d650b2ded1f..4644e8dcec77 100644
--- a/gcc/rust/ast/rust-expr.h
+++ b/gcc/rust/ast/rust-expr.h
@@ -3792,7 +3792,7 @@ public:
     outer_attrs = std::move (new_attrs);
   }
 
-  Expr::Kind get_expr_kind () const override { return Expr::Kind::Return; }
+  Expr::Kind get_expr_kind () const override { return Expr::Kind::Try; }
 
 protected:
   /* Use covariance to implement clone function as returning this object rather

Reply via email to