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
committerArthur Cohen <arthur.cohen@embecosm.com>2025-04-08 10:17:17 +0200
commitd7bbb929a884bd429bc4b43d9fed57d57ab285b4 (patch)
tree4da6da8f5801bf23a009122dcf1427aef43985ea /gcc/rust
parentd85a88aa3fdf2a5d66288d5809da864b956cc8d4 (diff)
downloadgcc-d7bbb929a884bd429bc4b43d9fed57d57ab285b4.zip
gcc-d7bbb929a884bd429bc4b43d9fed57d57ab285b4.tar.gz
gcc-d7bbb929a884bd429bc4b43d9fed57d57ab285b4.tar.bz2
gccrs: 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 6a81fa1..73c6b1e 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 ());
}