aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuhammad Mahad <mahadtxt@gmail.com>2023-08-08 18:39:29 +0500
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 19:00:28 +0100
commit9e208648cb9b1a4a52e5402ad9b1722ec690b0e7 (patch)
tree33fb4c4b0b190d026b9cc5e9e1f0041ac6088255
parent24fe3afef257015277591bace5e9f144913a8f53 (diff)
downloadgcc-9e208648cb9b1a4a52e5402ad9b1722ec690b0e7.zip
gcc-9e208648cb9b1a4a52e5402ad9b1722ec690b0e7.tar.gz
gcc-9e208648cb9b1a4a52e5402ad9b1722ec690b0e7.tar.bz2
gccrs: [E0015] Use of non-const inside const
gcc/rust/ChangeLog: * checks/errors/rust-const-checker.cc (ConstChecker::check_function_call): Added errorcode. Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
-rw-r--r--gcc/rust/checks/errors/rust-const-checker.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/rust/checks/errors/rust-const-checker.cc b/gcc/rust/checks/errors/rust-const-checker.cc
index 510b42d..e7e2bf7 100644
--- a/gcc/rust/checks/errors/rust-const-checker.cc
+++ b/gcc/rust/checks/errors/rust-const-checker.cc
@@ -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