public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Fix TyTy::ADTType is_equals to always check the variants for equality
@ 2022-06-08 12:12 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 12:12 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:fa21267280e488f78fb180704d1a80bee177c6ba

commit fa21267280e488f78fb180704d1a80bee177c6ba
Author: Philip Herron <philip.herron@embecosm.com>
Date:   Thu Feb 24 11:18:35 2022 +0000

    Fix TyTy::ADTType is_equals to always check the variants for equality

Diff:
---
 gcc/rust/typecheck/rust-tyty.cc | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/gcc/rust/typecheck/rust-tyty.cc b/gcc/rust/typecheck/rust-tyty.cc
index 0dde2998bf2..a58e1cdb4c4 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;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-08 12:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 12:12 [gcc/devel/rust/master] Fix TyTy::ADTType is_equals to always check the variants for equality Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).