From: Muhammad Mahad Date: Thu, 13 Jul 2023 08:57:37 +0000 (+0500) Subject: gccrs: [E0133] Use of unsafe code outside of unsafe function or block X-Git-Tag: basepoints/gcc-15~2351 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0da798e3666af22ebdf58d39198acff1de71a33b;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/rust/checks/errors/rust-unsafe-checker.cc b/gcc/rust/checks/errors/rust-unsafe-checker.cc index 49d1907007a2..5b259f76283d 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 ()); }