From cd587fbc1de242a389209974f468dcd8094abb74 Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Thu, 20 Apr 2023 11:55:20 +0100 Subject: [PATCH] gccrs: Fix ICE in assignment of error type bound predicates 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 --- gcc/rust/typecheck/rust-tyty-bounds.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/rust/typecheck/rust-tyty-bounds.cc b/gcc/rust/typecheck/rust-tyty-bounds.cc index 23a2926faeba..dc4418ff27b7 100644 --- a/gcc/rust/typecheck/rust-tyty-bounds.cc +++ b/gcc/rust/typecheck/rust-tyty-bounds.cc @@ -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 mappings; for (size_t i = 0; i < other.used_arguments.get_mappings ().size (); i++) { -- 2.47.2