]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: [E0015] Use of non-const inside const
authorMuhammad Mahad <mahadtxt@gmail.com>
Tue, 8 Aug 2023 13:39:29 +0000 (18:39 +0500)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:00:28 +0000 (19:00 +0100)
gcc/rust/ChangeLog:

* checks/errors/rust-const-checker.cc (ConstChecker::check_function_call):
Added errorcode.

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
gcc/rust/checks/errors/rust-const-checker.cc

index 510b42d090c96afa2714e18fc33421237d2cb915..e7e2bf781fc6c2abb96546ad274898b773f52094 100644 (file)
@@ -339,8 +339,9 @@ ConstChecker::check_function_call (HirId fn_id, location_t locus)
     }
 
   if (is_error)
-    rust_error_at (locus, "only functions marked as %<const%> are allowed to "
-                         "be called from constant contexts");
+    rust_error_at (locus, ErrorCode::E0015,
+                  "only functions marked as %<const%> are allowed to be "
+                  "called from constant contexts");
 }
 
 void