]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: [E0093] Declaration of unknown intrinsic function
authorMuhammad Mahad <mahadtxt@gmail.com>
Tue, 11 Jul 2023 09:27:53 +0000 (14:27 +0500)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:49:37 +0000 (18:49 +0100)
Refactored error message similiar to rustc.

gcc/rust/ChangeLog:

* backend/rust-compile-intrinsic.cc (Intrinsics::compile):
called error function.

gcc/testsuite/ChangeLog:

* rust/compile/torture/intrinsics-3.rs: Updated comment to pass the test case.

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
gcc/rust/backend/rust-compile-intrinsic.cc
gcc/testsuite/rust/compile/torture/intrinsics-3.rs

index 9155561a2b2108ec7fda83f77a5682b1391dfc08..0034f1e1188d41a728410fb17899d0240c594c3e 100644 (file)
@@ -228,7 +228,8 @@ Intrinsics::compile (TyTy::FnType *fntype)
     return it->second (ctx, fntype);
 
   Location locus = ctx->get_mappings ()->lookup_location (fntype->get_ref ());
-  rust_error_at (locus, "unknown builtin intrinsic: %s",
+  rust_error_at (locus, ErrorCode ("E0093"),
+                "unrecognized intrinsic function: %<%s%>",
                 fntype->get_identifier ().c_str ());
 
   return error_mark_node;
index 1601ab6d5b7e9193ea4d0ca996919e8518d37149..fd3567330e13df8a3e169d87ddf156c2330b2de0 100644 (file)
@@ -5,5 +5,5 @@ extern "rust-intrinsic" {
 }
 
 fn main() {
-    unsafe { not_an_intrinsic() }; // { dg-error "unknown builtin intrinsic: not_an_intrinsic" }
+    unsafe { not_an_intrinsic() }; // { dg-error "unrecognized intrinsic function: .not_an_intrinsic." }
 }