From: Philip Herron Date: Mon, 29 Jun 2026 17:06:14 +0000 (+0100) Subject: gccrs: Fix unify code on ADT's to check defid X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1fe3817daa73c8eba1180edccbca9b29a74e12af;p=thirdparty%2Fgcc.git gccrs: Fix unify code on ADT's to check defid There is a simple upfront check on ADT's we can check that def-id's match before continuing to unify them. gcc/rust/ChangeLog: * typecheck/rust-unify.cc (UnifyRules::expect_adt): check defid Signed-off-by: Philip Herron --- diff --git a/gcc/rust/typecheck/rust-unify.cc b/gcc/rust/typecheck/rust-unify.cc index 719e21f449e..32aebff5259 100644 --- a/gcc/rust/typecheck/rust-unify.cc +++ b/gcc/rust/typecheck/rust-unify.cc @@ -591,6 +591,11 @@ UnifyRules::expect_adt (TyTy::ADTType *ltype, TyTy::BaseType *rtype) return unify_error_type_node (); } + if (ltype->get_id () != type.get_id ()) + { + return unify_error_type_node (); + } + if (ltype->get_identifier ().compare (type.get_identifier ()) != 0) { return unify_error_type_node ();