Skip to content

Commit

Permalink
gccrs: [E0015] Use of non-const inside const
Browse files Browse the repository at this point in the history
gcc/rust/ChangeLog:

	* checks/errors/rust-const-checker.cc (ConstChecker::check_function_call):
	Added errorcode.

Signed-off-by: Muhammad Mahad <[email protected]>
  • Loading branch information
MahadMuhammad authored and philberty committed Aug 9, 2023
1 parent 2fcf448 commit 87172a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gcc/rust/checks/errors/rust-const-checker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,9 @@ ConstChecker::check_function_call (HirId fn_id, location_t locus)
}

if (is_error)
rust_error_at (locus, "only functions marked as %<const%> are allowed to "
"be called from constant contexts");
rust_error_at (locus, ErrorCode::E0015,
"only functions marked as %<const%> are allowed to be "
"called from constant contexts");
}

void
Expand Down

0 comments on commit 87172a8

Please sign in to comment.