aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMuhammad Mahad <mahadtxt@gmail.com>2023-07-13 13:57:37 +0500
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:49:37 +0100
commit0da798e3666af22ebdf58d39198acff1de71a33b (patch)
tree4cf26436a1b74915ce8105f77bbc209cb64fa68e /gcc
parentffadba42b3022855db48bdd94e0c95a8480bc278 (diff)
downloadgcc-0da798e3666af22ebdf58d39198acff1de71a33b.zip
gcc-0da798e3666af22ebdf58d39198acff1de71a33b.tar.gz
gcc-0da798e3666af22ebdf58d39198acff1de71a33b.tar.bz2
gccrs: [E0133] Use of unsafe code outside of unsafe function or block
gcc/rust/ChangeLog: * checks/errors/rust-unsafe-checker.cc (check_unsafe_call): called error function. Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/checks/errors/rust-unsafe-checker.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/rust/checks/errors/rust-unsafe-checker.cc b/gcc/rust/checks/errors/rust-unsafe-checker.cc
index 49d1907..5b259f7 100644
--- a/gcc/rust/checks/errors/rust-unsafe-checker.cc
+++ b/gcc/rust/checks/errors/rust-unsafe-checker.cc
@@ -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 ());
}