]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Fix ICE in assignment of error type bound predicates
authorPhilip Herron <herron.philip@googlemail.com>
Thu, 20 Apr 2023 10:55:20 +0000 (11:55 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:34:13 +0000 (18:34 +0100)
gcc/rust/ChangeLog:

* typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::operator=):
we are done if other is in an error state

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/typecheck/rust-tyty-bounds.cc

index 23a2926faeba8daff9b1d396944d66fa248bf2af..dc4418ff27b7725fcd614aaaf661398e686eb2ab 100644 (file)
@@ -360,6 +360,9 @@ TypeBoundPredicate::operator= (const TypeBoundPredicate &other)
   for (const auto &p : other.get_substs ())
     substitutions.push_back (p.clone ());
 
+  if (other.is_error ())
+    return *this;
+
   std::vector<SubstitutionArg> mappings;
   for (size_t i = 0; i < other.used_arguments.get_mappings ().size (); i++)
     {