Skip to content

Commit

Permalink
compile: bail on labelled block
Browse files Browse the repository at this point in the history
gcc/rust/ChangeLog:

	* backend/rust-compile-expr.cc (CompileExpr::visit): Bail on labelled block.

Signed-off-by: Jakub Dupak <[email protected]>
  • Loading branch information
jdupak authored and P-E-P committed Oct 20, 2023
1 parent 8ad5830 commit 9a53cb5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gcc/rust/backend/rust-compile-expr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 9a53cb5

Please sign in to comment.