From 3673b0b3b729cf4e8f9abe01096ecdfad0ad3d5f Mon Sep 17 00:00:00 2001 From: Yizhe Date: Fri, 19 Feb 2021 09:29:17 +0000 Subject: Fixed unsigned and signed comparision --- gcc/rust/typecheck/rust-tyty.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gcc') diff --git a/gcc/rust/typecheck/rust-tyty.cc b/gcc/rust/typecheck/rust-tyty.cc index 30d821f..66b87e3 100644 --- a/gcc/rust/typecheck/rust-tyty.cc +++ b/gcc/rust/typecheck/rust-tyty.cc @@ -193,7 +193,7 @@ ADTType::is_equal (const BaseType &other) const { return false; } - for (int i = 0; i < num_fields (); i++) + for (size_t i = 0; i < num_fields (); i++) { if (!get_field (i)->is_equal (*other2.get_field (i))) { @@ -264,7 +264,7 @@ TupleType::is_equal (const BaseType &other) const { return false; } - for (int i = 0; i < num_fields (); i++) + for (size_t i = 0; i < num_fields (); i++) { if (!get_field (i)->is_equal (*other2.get_field (i))) { @@ -325,7 +325,7 @@ FnType::is_equal (const BaseType &other) const return false; if (num_params () != other2.num_params ()) return false; - for (int i = 0; i < num_params (); i++) + for (size_t i = 0; i < num_params (); i++) { auto lhs = param_at (i).second; auto rhs = other2.param_at (i).second; -- cgit v1.1