Skip to content

Commit d20a2c2

Browse files
MahadMuhammadCohenArthur
authored andcommitted
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 <[email protected]>
1 parent cc167a9 commit d20a2c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gcc/rust/typecheck/rust-hir-type-check-expr.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ TypeCheckExpr::visit (HIR::ReturnExpr &expr)
152152
{
153153
if (!context->have_function_context ())
154154
{
155-
rust_error_at (expr.get_locus (),
155+
rust_error_at (expr.get_locus (), ErrorCode::E0572,
156156
"return statement outside of function body");
157157
infered = new TyTy::ErrorType (expr.get_mappings ().get_hirid ());
158158
return;

0 commit comments

Comments
 (0)