Skip to content

Commit

Permalink
gccrs: [E0572] return is outside of function context
Browse files Browse the repository at this point in the history
gcc/rust/ChangeLog:

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

Signed-off-by: Muhammad Mahad <[email protected]>
  • Loading branch information
MahadMuhammad authored and CohenArthur committed Aug 1, 2023
1 parent cc167a9 commit d20a2c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gcc/rust/typecheck/rust-hir-type-check-expr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d20a2c2

Please sign in to comment.