]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: ast: Add Expr::Kind::Try
authorArthur Cohen <arthur.cohen@embecosm.com>
Tue, 22 Jul 2025 11:38:26 +0000 (13:38 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 5 Aug 2025 14:36:58 +0000 (16:36 +0200)
gcc/rust/ChangeLog:

* ast/rust-ast.h: Add the new variant.
* ast/rust-expr.h: Use it for TryExpr class.

gcc/rust/ast/rust-ast.h
gcc/rust/ast/rust-expr.h

index 0d853e744c76b5e3d066bdfcaa6f75d45617fbc3..33c50b71d38d216e7b578251dec1ccff59a656d2 100644 (file)
@@ -1318,6 +1318,7 @@ public:
     TypeCast,
     Assignment,
     CompoundAssignment,
+    Try,
   };
 
   virtual Kind get_expr_kind () const = 0;
index 8d650b2ded1f920748db4dd06e95236dcad39f17..4644e8dcec77a554d19a00644878f02a12676359 100644 (file)
@@ -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