From: Muhammad Mahad Date: Mon, 31 Jul 2023 10:21:58 +0000 (+0500) Subject: gccrs: [E0572] return is outside of function context X-Git-Tag: basepoints/gcc-15~2267 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=47576fa5a866ad0d7ff0112e7d4a9f3dd764f7cc;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.cc b/gcc/rust/typecheck/rust-hir-type-check-expr.cc index 74c4217e5786..c7b124864c94 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;