aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-desugar-try-block.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/ast/rust-desugar-try-block.cc')
-rw-r--r--gcc/rust/ast/rust-desugar-try-block.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-desugar-try-block.cc b/gcc/rust/ast/rust-desugar-try-block.cc
index cd03350..07f06aa 100644
--- a/gcc/rust/ast/rust-desugar-try-block.cc
+++ b/gcc/rust/ast/rust-desugar-try-block.cc
@@ -28,6 +28,8 @@ DesugarTryBlock::DesugarTryBlock () {}
void
DesugarTryBlock::go (std::unique_ptr<Expr> &ptr)
{
+ rust_assert (ptr->get_expr_kind () == Expr::Kind::Try);
+
auto original = static_cast<TryExpr &> (*ptr);
auto desugared = DesugarTryBlock ().desugar (original);