aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Dupak <dev@jakubdupak.com>2023-10-16 15:33:19 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 19:09:21 +0100
commit4331ce6917af68576a28b4f1d831948c579b36f6 (patch)
tree54c302dab17fca3baa0634f32ea80cba23850bf1
parent1f40ed03c56a3801ee7c8be463d25d175505b713 (diff)
downloadgcc-4331ce6917af68576a28b4f1d831948c579b36f6.zip
gcc-4331ce6917af68576a28b4f1d831948c579b36f6.tar.gz
gcc-4331ce6917af68576a28b4f1d831948c579b36f6.tar.bz2
gccrs: compile: bail on labelled block
gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::visit): Bail on labelled block. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
-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 2e4bd57..8e64e57 100644
--- a/gcc/rust/backend/rust-compile-expr.cc
+++ b/gcc/rust/backend/rust-compile-expr.cc
@@ -352,6 +352,12 @@ CompileExpr::visit (HIR::IfExprConseqElse &expr)
void
CompileExpr::visit (HIR::BlockExpr &expr)
{
+ if (expr.has_label ())
+ {
+ rust_error_at (expr.get_locus (), "labeled blocks are not supported");
+ return;
+ }
+
TyTy::BaseType *block_tyty = nullptr;
if (!ctx->get_tyctx ()->lookup_type (expr.get_mappings ().get_hirid (),
&block_tyty))