Skip to content

Commit

Permalink
gccrs: [E0133] Use of unsafe code outside of unsafe function or block
Browse files Browse the repository at this point in the history
gcc/rust/ChangeLog:

	* checks/errors/rust-unsafe-checker.cc (check_unsafe_call):
	called error function.

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
  • Loading branch information
MahadMuhammad authored and philberty committed Jul 13, 2023
1 parent 446ef14 commit 601c289
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gcc/rust/checks/errors/rust-unsafe-checker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ static void
check_unsafe_call (HIR::Function *fn, Location locus, const std::string &kind)
{
if (fn->get_qualifiers ().is_unsafe ())
rust_error_at (locus, "call to unsafe %s requires unsafe function or block",
rust_error_at (locus, ErrorCode ("E0133"),
"call to unsafe %s requires unsafe function or block",
kind.c_str ());
}

Expand Down

0 comments on commit 601c289

Please sign in to comment.