diff options
author | Muhammad Mahad <mahadtxt@gmail.com> | 2023-06-22 13:04:12 +0500 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-06-25 20:41:35 +0000 |
commit | 04eb580efaad6d74a6d93b47fc551f93cf40577d (patch) | |
tree | 81952837eac62483d72951567028bdd0e0461b36 | |
parent | 210557d8a4129e2b240cbbcc84c0edb18b81a397 (diff) | |
download | gcc-04eb580efaad6d74a6d93b47fc551f93cf40577d.zip gcc-04eb580efaad6d74a6d93b47fc551f93cf40577d.tar.gz gcc-04eb580efaad6d74a6d93b47fc551f93cf40577d.tar.bz2 |
ErrorCode[E0277] Type Does Not Implement Expected Trait
Type Does Not Implement Expected Trait - the type [{integer}] cannot be indexed by u32
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): passed "E0277"
* typecheck/rust-tyty.cc (BaseType::bounds_compatible): passed "E0277"
Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
-rw-r--r-- | gcc/rust/typecheck/rust-hir-type-check-expr.cc | 3 | ||||
-rw-r--r-- | gcc/rust/typecheck/rust-tyty.cc | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.cc b/gcc/rust/typecheck/rust-hir-type-check-expr.cc index 1db4cff..bd30746 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-expr.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-expr.cc @@ -867,7 +867,8 @@ TypeCheckExpr::visit (HIR::ArrayIndexExpr &expr) RichLocation r (expr.get_locus ()); r.add_range (expr.get_array_expr ()->get_locus ()); r.add_range (expr.get_index_expr ()->get_locus ()); - rust_error_at (r, "the type %<%s%> cannot be indexed by %<%s%>", + rust_error_at (r, ErrorCode ("E0277"), + "the type %<%s%> cannot be indexed by %<%s%>", array_expr_ty->get_name ().c_str (), index_expr_ty->get_name ().c_str ()); } diff --git a/gcc/rust/typecheck/rust-tyty.cc b/gcc/rust/typecheck/rust-tyty.cc index 312fc59..e68979c 100644 --- a/gcc/rust/typecheck/rust-tyty.cc +++ b/gcc/rust/typecheck/rust-tyty.cc @@ -396,7 +396,7 @@ BaseType::bounds_compatible (const BaseType &other, Location locus, if (emit_error) { - rust_error_at (r, + rust_error_at (r, ErrorCode ("E0277"), "bounds not satisfied for %s %<%s%> is not satisfied", other.get_name ().c_str (), missing_preds.c_str ()); // rust_assert (!emit_error); |