]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: ErrorCode[E0277] Type Does Not Implement Expected Trait
authorMuhammad Mahad <mahadtxt@gmail.com>
Thu, 22 Jun 2023 08:04:12 +0000 (13:04 +0500)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:46:29 +0000 (18:46 +0100)
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>
gcc/rust/typecheck/rust-hir-type-check-expr.cc
gcc/rust/typecheck/rust-tyty.cc

index 8bbbc224c8d3da73e079418c617e1cb45a251862..734c4b49a5f2b685a04db97de436e93097b73760 100644 (file)
@@ -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 ());
 }
index 143cab42ab529429c7aff5f9c5439d8864b1f5a4..06a8e7085364c96130ef286cad4ad92c3bb14b5c 100644 (file)
@@ -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);