From: Jakub Dupak Date: Mon, 16 Oct 2023 13:33:19 +0000 (+0200) Subject: gccrs: compile: bail on labelled block X-Git-Tag: basepoints/gcc-15~2075 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4331ce6917af68576a28b4f1d831948c579b36f6;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc index 2e4bd57b3778..8e64e572bf2e 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))