aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMuhammad Mahad <mahadtxt@gmail.com>2023-08-08 18:39:29 +0500
committerPhilip Herron <philip.herron@embecosm.com>2023-08-09 09:18:19 +0000
commit87172a8bf9fe577be000b389ff8a45d5fcb326dc (patch)
tree94eda53022e391c7933a4f958f0204923c06211d /gcc
parent2fcf448238c979afb7e4bb37dc6cd20b4c3cb7b1 (diff)
downloadgcc-87172a8bf9fe577be000b389ff8a45d5fcb326dc.zip
gcc-87172a8bf9fe577be000b389ff8a45d5fcb326dc.tar.gz
gcc-87172a8bf9fe577be000b389ff8a45d5fcb326dc.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>
Diffstat (limited to 'gcc')
-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 4361834..599854a 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