From 5f25f457eca1e04e577aae8e60fe640bb32d36fc Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Mon, 17 Oct 2022 17:18:30 +0100 Subject: Add hir lowering of closure expressions In the AST we have ClosureExprInner and ClosureExprInnerTyped the first is the closure expression of the form: let closure_inferred = |i| i + 1; The second is of the form: let closure_annotated = |i: i32| -> i32 { i + 1 }; Both of these can be seguared into a single HIR::ClosureExpr with an optional return type and parameter types. Addresses #195 --- gcc/rust/backend/rust-compile-expr.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gcc/rust/backend/rust-compile-expr.cc') diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc index 9ff2be6..d66aa5d 100644 --- a/gcc/rust/backend/rust-compile-expr.cc +++ b/gcc/rust/backend/rust-compile-expr.cc @@ -2798,5 +2798,11 @@ CompileExpr::visit (HIR::ArrayIndexExpr &expr) expr.get_locus ()); } +void +CompileExpr::visit (HIR::ClosureExpr &expr) +{ + gcc_unreachable (); +} + } // namespace Compile } // namespace Rust -- cgit v1.1