From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7905) id 793A5384F036; Tue, 31 Jan 2023 13:15:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 793A5384F036 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675170953; bh=3M5iyLxFGYFMF/SQq1/S2vz8ViN2pyhLnOZ9xqfkMi4=; h=From:To:Subject:Date:From; b=fp2/1B1qidIxYeLAYip6Q/ok4S61UN59+uXkugVdsHIPQlUMBnKY4DVS4+i0mM6U0 LkJ7WzuJal88F98HcaXaLKKBMdzP6NfsXWv+eoeMQGmenjMF1v5X3BBMR8CroN0W+I l9QUwBDDZ9R52+DGlruIWV4O4TpCnfZ1OfDZWk50= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Arthur Cohen To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-5553] gccrs: Unit structs are not concrete when they need substitutions X-Act-Checkin: gcc X-Git-Author: Philip Herron X-Git-Refname: refs/heads/master X-Git-Oldrev: e641158a5f5cd80ee2ce32fded1179ce1b3e1193 X-Git-Newrev: 0fffc0e772d612d5c6ad72a632ac80b43eca1950 Message-Id: <20230131131553.793A5384F036@sourceware.org> Date: Tue, 31 Jan 2023 13:15:53 +0000 (GMT) List-Id: https://gcc.gnu.org/g:0fffc0e772d612d5c6ad72a632ac80b43eca1950 commit r13-5553-g0fffc0e772d612d5c6ad72a632ac80b43eca1950 Author: Philip Herron Date: Wed Aug 31 17:16:13 2022 +0100 gccrs: Unit structs are not concrete when they need substitutions Fixes #1518 gcc/rust/ChangeLog: * typecheck/rust-tyty.h: Fix `is_concrete` for unit types with substitutions. Diff: --- gcc/rust/typecheck/rust-tyty.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h index 24efc7aa54c..43460d2dd2f 100644 --- a/gcc/rust/typecheck/rust-tyty.h +++ b/gcc/rust/typecheck/rust-tyty.h @@ -1362,6 +1362,11 @@ public: bool is_concrete () const override final { + if (is_unit ()) + { + return !needs_substitution (); + } + for (auto &variant : variants) { for (auto &field : variant->get_fields ())