Skip to content

Commit 805d332

Browse files
CohenArthurP-E-P
authored andcommitted
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.
1 parent f70b5e0 commit 805d332

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gcc/rust/ast/rust-ast-visitor.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,13 @@ DefaultASTVisitor::visit (AST::BlockExpr &expr)
449449
{
450450
visit_outer_attrs (expr);
451451
visit_inner_attrs (expr);
452+
453+
if (expr.has_label ())
454+
visit (expr.get_label ());
455+
452456
for (auto &stmt : expr.get_statements ())
453457
visit (stmt);
458+
454459
if (expr.has_tail_expr ())
455460
visit (expr.get_tail_expr ());
456461
}

0 commit comments

Comments
 (0)