]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: [E0268] break or continue used outside of loop
authorMuhammad Mahad <mahadtxt@gmail.com>
Wed, 19 Jul 2023 15:54:28 +0000 (20:54 +0500)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:55:57 +0000 (18:55 +0100)
commitf67f840d291516112b530d961fc73d5a2ace77e2
tree103e1dddb9550ba4c8e68b338176d3966b9f4aaf
parentdbe2f8ad4dbaad9e6f718eca311cce5bffd02bc3
gccrs: [E0268] break or continue used outside of loop

Refactored error description similiar to rustc.

gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
refactored and call error function.

gcc/testsuite/ChangeLog:

* rust/compile/break1.rs: Modified to pass test case.
* rust/compile/continue1.rs: likewise.
* rust/compile/break_continue_outside_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/break1.rs
gcc/testsuite/rust/compile/break_continue_outside_loop.rs [new file with mode: 0644]
gcc/testsuite/rust/compile/continue1.rs