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>
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 ());
}
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);