Skip to content

Commit 50010b8

Browse files
MahadMuhammadCohenArthur
authored andcommitted
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 <[email protected]>
1 parent 2bc1a68 commit 50010b8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

gcc/rust/typecheck/rust-hir-type-check-expr.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,8 @@ TypeCheckExpr::visit (HIR::ArrayIndexExpr &expr)
867867
RichLocation r (expr.get_locus ());
868868
r.add_range (expr.get_array_expr ()->get_locus ());
869869
r.add_range (expr.get_index_expr ()->get_locus ());
870-
rust_error_at (r, "the type %<%s%> cannot be indexed by %<%s%>",
870+
rust_error_at (r, ErrorCode ("E0277"),
871+
"the type %<%s%> cannot be indexed by %<%s%>",
871872
array_expr_ty->get_name ().c_str (),
872873
index_expr_ty->get_name ().c_str ());
873874
}

gcc/rust/typecheck/rust-tyty.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ BaseType::bounds_compatible (const BaseType &other, Location locus,
396396

397397
if (emit_error)
398398
{
399-
rust_error_at (r,
399+
rust_error_at (r, ErrorCode ("E0277"),
400400
"bounds not satisfied for %s %<%s%> is not satisfied",
401401
other.get_name ().c_str (), missing_preds.c_str ());
402402
// rust_assert (!emit_error);

0 commit comments

Comments
 (0)