aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-expr.cc
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-10-17 17:18:30 +0100
committerPhilip Herron <philip.herron@embecosm.com>2022-10-19 19:32:47 +0100
commit5f25f457eca1e04e577aae8e60fe640bb32d36fc (patch)
treea7d78407c59d8614c4b20687da9421a2d3fce5f1 /gcc/rust/backend/rust-compile-expr.cc
parent851b9e14585160f70eb17a9b312c14e3a0d4c3ed (diff)
downloadgcc-5f25f457eca1e04e577aae8e60fe640bb32d36fc.zip
gcc-5f25f457eca1e04e577aae8e60fe640bb32d36fc.tar.gz
gcc-5f25f457eca1e04e577aae8e60fe640bb32d36fc.tar.bz2
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
Diffstat (limited to 'gcc/rust/backend/rust-compile-expr.cc')
-rw-r--r--gcc/rust/backend/rust-compile-expr.cc6
1 files changed, 6 insertions, 0 deletions
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