From 0d4b15cb70f2ab20e9b8a533f592cbb6fc8efe87 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Sun, 22 Dec 2024 15:59:27 +0000 Subject: ast: Add DesugarForLoop class gcc/rust/ChangeLog: * ast/rust-desugar-for-loops.cc: New file. * ast/rust-desugar-for-loops.h: New file. * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Make lowering of for-loops an unreachable. * Make-lang.in: Compile it. gcc/testsuite/ChangeLog: * rust/compile/for-loop1.rs: New test. * rust/compile/for-loop2.rs: New test. * rust/execute/torture/for-loop1.rs: New test. * rust/execute/torture/for-loop2.rs: New test. * rust/compile/nr2/exclude: Exclude for-loop1.rs --- gcc/rust/hir/rust-ast-lower-expr.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/rust/hir') diff --git a/gcc/rust/hir/rust-ast-lower-expr.cc b/gcc/rust/hir/rust-ast-lower-expr.cc index 1b061b3..46e35ee 100644 --- a/gcc/rust/hir/rust-ast-lower-expr.cc +++ b/gcc/rust/hir/rust-ast-lower-expr.cc @@ -591,7 +591,7 @@ ASTLoweringExpr::visit (AST::WhileLoopExpr &expr) void ASTLoweringExpr::visit (AST::ForLoopExpr &expr) { - translated = ASTLoweringExprWithBlock::translate (expr, &terminated); + rust_unreachable (); } void -- cgit v1.1