aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-02-24 11:18:35 +0000
committerPhilip Herron <philip.herron@embecosm.com>2022-02-24 11:20:19 +0000
commitfa21267280e488f78fb180704d1a80bee177c6ba (patch)
tree16b7071de3ca97550c924d9464072909d44e5b15 /gcc/rust
parenta64983f86c8703d1229a7e8ee0baff07110f5a7c (diff)
downloadgcc-fa21267280e488f78fb180704d1a80bee177c6ba.zip
gcc-fa21267280e488f78fb180704d1a80bee177c6ba.tar.gz
gcc-fa21267280e488f78fb180704d1a80bee177c6ba.tar.bz2
Fix TyTy::ADTType is_equals to always check the variants for equality
Diffstat (limited to 'gcc/rust')
-rw-r--r--gcc/rust/typecheck/rust-tyty.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/rust/typecheck/rust-tyty.cc b/gcc/rust/typecheck/rust-tyty.cc
index 0dde299..a58e1cd 100644
--- a/gcc/rust/typecheck/rust-tyty.cc
+++ b/gcc/rust/typecheck/rust-tyty.cc
@@ -840,16 +840,14 @@ ADTType::is_equal (const BaseType &other) const
return false;
}
}
- else
+
+ for (size_t i = 0; i < number_of_variants (); i++)
{
- for (size_t i = 0; i < number_of_variants (); i++)
- {
- const TyTy::VariantDef *a = get_variants ().at (i);
- const TyTy::VariantDef *b = other2.get_variants ().at (i);
+ const TyTy::VariantDef *a = get_variants ().at (i);
+ const TyTy::VariantDef *b = other2.get_variants ().at (i);
- if (!a->is_equal (*b))
- return false;
- }
+ if (!a->is_equal (*b))
+ return false;
}
return true;