We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent efbe8cc commit 8567160Copy full SHA for 8567160
gcc/rust/analysis/rust-type-resolution.cc
@@ -496,7 +496,15 @@ TypeResolution::visit (AST::ArrayIndexExpr &expr)
496
497
// check the index_type should be an i32 which should really be
498
// more permissive
499
- // TODO
+ AST::Type *i32 = nullptr;
500
+ scope.LookupType ("i32", &i32);
501
+ rust_assert (i32 != nullptr);
502
+
503
+ if (!typesAreCompatible (array_index_type, i32,
504
+ expr.get_index_expr ()->get_locus_slow ()))
505
+ {
506
+ return;
507
+ }
508
509
// the the element type from the array_expr_type and it _must_ be an array
510
AST::ArrayType *resolved = ArrayTypeVisitor::Resolve (array_expr_type);
0 commit comments