aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuhammad Mahad <mahadtxt@gmail.com>2023-07-31 15:21:58 +0500
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:56:04 +0100
commit47576fa5a866ad0d7ff0112e7d4a9f3dd764f7cc (patch)
tree77fc226f46373868a0c20c5687e259ee264a9324
parentc016d443b814a49fa1f91a08bed12577885f40d9 (diff)
downloadgcc-47576fa5a866ad0d7ff0112e7d4a9f3dd764f7cc.zip
gcc-47576fa5a866ad0d7ff0112e7d4a9f3dd764f7cc.tar.gz
gcc-47576fa5a866ad0d7ff0112e7d4a9f3dd764f7cc.tar.bz2
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>
-rw-r--r--gcc/rust/typecheck/rust-hir-type-check-expr.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.cc b/gcc/rust/typecheck/rust-hir-type-check-expr.cc
index 74c4217..c7b1248 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;