aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend
diff options
context:
space:
mode:
authorMuhammad Mahad <mahadtxt@gmail.com>2023-08-05 12:55:36 +0500
committerP-E-P <32375388+P-E-P@users.noreply.github.com>2023-08-09 12:05:21 +0000
commit67d1f4a53e124ff4e0293449a9a73d5e0a012c8e (patch)
tree9e4e89d28fdf85061a9fe1a885dc50fef58a259d /gcc/rust/backend
parenta58485620d6bf6579a669b209410cb81915405a4 (diff)
downloadgcc-67d1f4a53e124ff4e0293449a9a73d5e0a012c8e.zip
gcc-67d1f4a53e124ff4e0293449a9a73d5e0a012c8e.tar.gz
gcc-67d1f4a53e124ff4e0293449a9a73d5e0a012c8e.tar.bz2
gccrs: [E0308] array misamatch types
gcc/rust/ChangeLog: * backend/rust-compile.cc (HIRCompileBase::verify_array_capacities): Added ErrorCode. gcc/testsuite/ChangeLog: * rust/compile/arrays2.rs: changed comment to pass testcase. Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
Diffstat (limited to 'gcc/rust/backend')
-rw-r--r--gcc/rust/backend/rust-compile.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/rust/backend/rust-compile.cc b/gcc/rust/backend/rust-compile.cc
index 755c971..14bb553 100644
--- a/gcc/rust/backend/rust-compile.cc
+++ b/gcc/rust/backend/rust-compile.cc
@@ -401,11 +401,12 @@ HIRCompileBase::verify_array_capacities (tree ltype, tree rtype,
if (ltype_length != rtype_length)
{
- rust_error_at (
- rvalue_locus,
- "expected an array with a fixed size of " HOST_WIDE_INT_PRINT_UNSIGNED
- " elements, found one with " HOST_WIDE_INT_PRINT_UNSIGNED " elements",
- ltype_length, rtype_length);
+ rust_error_at (rvalue_locus, ErrorCode::E0308,
+ "mismatched types, expected an array with a fixed size "
+ "of " HOST_WIDE_INT_PRINT_UNSIGNED
+ " elements, found one with " HOST_WIDE_INT_PRINT_UNSIGNED
+ " elements",
+ ltype_length, rtype_length);
return false;
}