aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Dupak <dev@jakubdupak.com>2023-10-16 15:33:19 +0200
committerP-E-P <32375388+P-E-P@users.noreply.github.com>2023-10-20 08:35:27 +0000
commit9a53cb5c38365773ae22590efb89bdd7f0480f4c (patch)
tree14f05e703062e1a27665fe70309a4dc7f594829f
parent8ad583020b0279f02edd76d2512c36c56977ec41 (diff)
downloadgcc-9a53cb5c38365773ae22590efb89bdd7f0480f4c.zip
gcc-9a53cb5c38365773ae22590efb89bdd7f0480f4c.tar.gz
gcc-9a53cb5c38365773ae22590efb89bdd7f0480f4c.tar.bz2
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 9796995..2882f8e 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))