]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: [E0572] return is outside of function context
authorMuhammad Mahad <mahadtxt@gmail.com>
Mon, 31 Jul 2023 10:21:58 +0000 (15:21 +0500)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:56:04 +0000 (18:56 +0100)
gcc/rust/ChangeLog:

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

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
gcc/rust/typecheck/rust-hir-type-check-expr.cc

index 74c4217e578674702799e780f92ac43a9b8b63f3..c7b124864c9423f51f72a84a39c964949c34425b 100644 (file)
@@ -152,7 +152,7 @@ TypeCheckExpr::visit (HIR::ReturnExpr &expr)
 {
   if (!context->have_function_context ())
     {
-      rust_error_at (expr.get_locus (),
+      rust_error_at (expr.get_locus (), ErrorCode::E0572,
                     "return statement outside of function body");
       infered = new TyTy::ErrorType (expr.get_mappings ().get_hirid ());
       return;