aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2025-04-01 12:02:31 +0200
committerP-E-P <32375388+P-E-P@users.noreply.github.com>2025-04-07 08:18:19 +0000
commitb079d612f685de0d7780837bae5bfe88ce46ccbe (patch)
treee63b30d1f589fdfa848f01a979677cd620953c66 /gcc/rust
parent676e3eacc36a233dec52023faa9f3c78007bbabe (diff)
downloadgcc-b079d612f685de0d7780837bae5bfe88ce46ccbe.zip
gcc-b079d612f685de0d7780837bae5bfe88ce46ccbe.tar.gz
gcc-b079d612f685de0d7780837bae5bfe88ce46ccbe.tar.bz2
Visit loop label before predicate expression
If the label is referenced within the while predicate expression it has to be resolved before the latter. gcc/rust/ChangeLog: * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Change default visit order. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove test from exclusion list. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc/rust')
-rw-r--r--gcc/rust/ast/rust-ast-visitor.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/ast/rust-ast-visitor.cc b/gcc/rust/ast/rust-ast-visitor.cc
index b5da001..7791489 100644
--- a/gcc/rust/ast/rust-ast-visitor.cc
+++ b/gcc/rust/ast/rust-ast-visitor.cc
@@ -567,9 +567,9 @@ void
DefaultASTVisitor::visit (AST::WhileLoopExpr &expr)
{
visit_outer_attrs (expr);
- visit (expr.get_predicate_expr ());
if (expr.has_loop_label ())
visit (expr.get_loop_label ());
+ visit (expr.get_predicate_expr ());
visit (expr.get_loop_block ());
}