From d8224f0222d8b6d99d98fe5038183f6d369ce286 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Mon, 21 Jul 2025 10:12:13 +0200 Subject: [PATCH] gccrs: ast: Visit block labels if they are present gcc/rust/ChangeLog: * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Visit a block's loop label if it exists. --- gcc/rust/ast/rust-ast-visitor.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/rust/ast/rust-ast-visitor.cc b/gcc/rust/ast/rust-ast-visitor.cc index 32d5d32e43f..7be2ecc1b48 100644 --- a/gcc/rust/ast/rust-ast-visitor.cc +++ b/gcc/rust/ast/rust-ast-visitor.cc @@ -449,8 +449,13 @@ DefaultASTVisitor::visit (AST::BlockExpr &expr) { visit_outer_attrs (expr); visit_inner_attrs (expr); + + if (expr.has_label ()) + visit (expr.get_label ()); + for (auto &stmt : expr.get_statements ()) visit (stmt); + if (expr.has_tail_expr ()) visit (expr.get_tail_expr ()); } -- 2.47.3