diff options
author | Muhammad Mahad <mahadtxt@gmail.com> | 2023-07-13 13:57:37 +0500 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-07-13 12:13:37 +0000 |
commit | 601c2893aa2d308051de5231e2b63f67170d55e9 (patch) | |
tree | 7b1574918829e5e051053c398a101c31fd8fbfd1 /gcc | |
parent | 446ef149ebec868103bdc5b72c879cb7b67697fc (diff) | |
download | gcc-601c2893aa2d308051de5231e2b63f67170d55e9.zip gcc-601c2893aa2d308051de5231e2b63f67170d55e9.tar.gz gcc-601c2893aa2d308051de5231e2b63f67170d55e9.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.cc | 3 |
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 12c9e86..7792b86 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 ()); } |