public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-7872] gccrs: [E0572] return is outside of function context
@ 2024-01-16 18:05 Arthur Cohen
  0 siblings, 0 replies; only message in thread
From: Arthur Cohen @ 2024-01-16 18:05 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:47576fa5a866ad0d7ff0112e7d4a9f3dd764f7cc

commit r14-7872-g47576fa5a866ad0d7ff0112e7d4a9f3dd764f7cc
Author: Muhammad Mahad <mahadtxt@gmail.com>
Date:   Mon Jul 31 15:21:58 2023 +0500

    gccrs: [E0572] return is outside of function context
    
    gcc/rust/ChangeLog:
    
            * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
            called error function.
    
    Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>

Diff:
---
 gcc/rust/typecheck/rust-hir-type-check-expr.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.cc b/gcc/rust/typecheck/rust-hir-type-check-expr.cc
index 74c4217e578..c7b124864c9 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-expr.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-expr.cc
@@ -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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-16 18:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-16 18:05 [gcc r14-7872] gccrs: [E0572] return is outside of function context Arthur Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).