]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Use a loop label in break expression
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 8 Nov 2023 15:34:19 +0000 (16:34 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:13:13 +0000 (19:13 +0100)
commitea59190d54612f9f0e09c77a0601023ef43f861d
treed8e349d42ce39bd9df6f16b4313d6415bc674626
parentb52651427be060094b2b1955d4425ddee73ef855
gccrs: Use a loop label in break expression

Break expression were using a raw lifetime value instead of a loop label
this behavior would have lead to some errors in ast validation.

gcc/rust/ChangeLog:

* ast/rust-expr.h (class BreakExpr): Change Lifetime to LoopLabel.
* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Lower lifetime
inside the label instead.
* resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Resolve the
inner lifetime.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-expr.h
gcc/rust/hir/rust-ast-lower-expr.cc
gcc/rust/resolve/rust-ast-resolve-expr.cc