From d7bbb929a884bd429bc4b43d9fed57d57ab285b4 Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Tue, 1 Apr 2025 12:02:31 +0200 Subject: 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 --- gcc/rust/ast/rust-ast-visitor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/rust/ast') 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 ()); } -- cgit v1.1