]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: [E0571] break with argument in non-loop loop
authorMuhammad Mahad <mahadtxt@gmail.com>
Thu, 27 Jul 2023 11:36:09 +0000 (16:36 +0500)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:56:02 +0000 (18:56 +0100)
commit55a3049525498a4c06e47c21c15f6b3d6eb1be29
treea75534d507c6db57dd34039278d4b1b44fc073a4
parent0680907b3b19273b908c91306932abbf82f85cce
gccrs: [E0571] break with argument in non-loop loop

Refactored error message similiar to rustc
& called error function.

gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
refactored error message & called error function.

gcc/testsuite/ChangeLog:

* rust/compile/break2.rs: Modified file to pass test case.
* rust/compile/break_with_value_inside_loop.rs: New test.

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
gcc/rust/typecheck/rust-hir-type-check-expr.cc
gcc/testsuite/rust/compile/break2.rs
gcc/testsuite/rust/compile/break_with_value_inside_loop.rs [new file with mode: 0644]