From patchwork Tue Jan 31 13:25:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 50864 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2751388wrn; Tue, 31 Jan 2023 05:32:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXt2rmoXFffhzGETkV76lJk/D8HdumPCafHgEKo+RzrP0iLgVAmwckzwcZGEXGK+L+HYWuPY X-Received: by 2002:a05:6402:28c7:b0:47e:f535:e9a0 with SMTP id ef7-20020a05640228c700b0047ef535e9a0mr58881021edb.24.1675171923834; Tue, 31 Jan 2023 05:32:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675171923; cv=none; d=google.com; s=arc-20160816; b=TbJLhEhjgU4BKdWMOFgIOoLInjMEBpp4h9q6GUeM9ZEGT9/HVw5Rau/48Ot2kPyXIw nxePs/7axWSgq0ZaL8ECde2yElfM7Lu/ltdEbN5s2dh+LP5Oi/hhpNmIMhk+0Mr61tyL Utyf+J95Jbn9eAdV5I8p0UWmr334pVAX808vBs3gU//SonFioVHNJROyZ6gj1jaL2p6G nEfrAtpuBjlsa6njmhzhIbe72wfQFfM8syquokDzcxnErPqvjVV6EqGRzOgay/gfUPnf TvR/NZxAqz8/J4Xa3pkvJifr198k/HbZWau2vFPd48gsDwThnmyS1Vpa4ibxF9FSjvMC 4yeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dmarc-filter:delivered-to; bh=xEIVl8j7SwllriuEz8bML0FaIwuQ1J8xIqRzM2EFad4=; b=Mb1TuQFJaIj1WulzqUtU3kmrsAArnMhtYYVsqJxAO2Zh5zfQT0L+LxyKXoboKilB4X 5EeekK7D8YetSypyL3bM99UFh/D9qMbtWypSJq8nqixp0lEEAitRFDTZmALDWFSxz6RF fiht+iJuhYu8xwfAoeQetbbi2xuUaWj+5owl87I7WKeCw54OZ/5YQlrozjyAXuj9OQ6Z Kn6+/iQli4FAUKTEaShWbmkeWDFE8LFR61dxjxItriCIEsCnH6+nwcV9R8K4ZrMZiJum FP2uN4PGR0X20cS4SubTLHtG2edFNLsGPM9Kj/FJvZfzw3Ad41yEt6Figs9Sf2Nz+DkU /Oog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=JFtkRcNT; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id l6-20020a056402254600b004a26619386dsi3939521edb.91.2023.01.31.05.32.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 05:32:03 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=JFtkRcNT; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7B245385CF39 for ; Tue, 31 Jan 2023 13:24:14 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 6CDA73889E2B for ; Tue, 31 Jan 2023 13:22:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6CDA73889E2B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x331.google.com with SMTP id f47-20020a05600c492f00b003dc584a7b7eso4418408wmp.3 for ; Tue, 31 Jan 2023 05:22:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=xEIVl8j7SwllriuEz8bML0FaIwuQ1J8xIqRzM2EFad4=; b=JFtkRcNTyOrp1xEajLmi7RGgaEg7VWN4O1jjsS8dZbJMrh8zYTvPnG/IRm++eEwmU1 oUuUrlkM8nsXgAHOLx4Oqwjy+vhnCpHW5BlNCbj9ygY2pGLsjsAEneKZ+C1cV7yQcx+B a0CeInVRU64lGz4PKEp109iT1lvUS+gjED1ZS5L4hhbZCMGm2xtsfqmZWiMxbD/KIov9 zHn7fXM/chaW+8pWy6VI0sow9C+hPDN6zz09s7FMbZ02o1irxBPMxictmMNgCL9o+nBi 5haKiiB7ok5fzAo51UDCsfDdqXLM4cCiDnUfplj0Qp0VYVz6XZChRQVh5Pob7kLca3W5 DiBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xEIVl8j7SwllriuEz8bML0FaIwuQ1J8xIqRzM2EFad4=; b=zL3Y3ZxwIFMIByb77y0QlA/J7j41qZ9KocyHCy0GyS9YqJ58WEFaU5n6CTT4RYjs03 tY1MfgJSyj3xEaOKSx+lXfk7ULlK2INY2cJqzf2MtpPeA7eDnUeBrGA2cDrlEgfQCSnV D7orbEIPChNUZj/aaoq0n1FR4mXX32FKRY8hPRIsoWgZWPzVfhKdGf+TEFUSmfU6aHzq NEqy69pQUJTRCBaFJQhfK8/LeVQ37R+688zLzfpv6KfwU3GDMypvzD7oWSop9s9wGEXv rBAsUuKOMX4v7HYsh8kY92W2C4OA+y3dvqz3sukGP7fwiDt0Ik72kmas4nHQSyYx0DRZ oX1w== X-Gm-Message-State: AO0yUKUjFSYvZTM/rDd8H2mbcK+krbSF79VEBMJaSwp/wHOh7kLS/SHJ o+2gyIg7LCLbOAnRdQnmVutPX61fc5NVIG/ulQ== X-Received: by 2002:a05:600c:188a:b0:3dc:506e:6559 with SMTP id x10-20020a05600c188a00b003dc506e6559mr11868654wmp.37.1675171325079; Tue, 31 Jan 2023 05:22:05 -0800 (PST) Received: from platypus.lan ([2001:861:5e4c:3bb0:6424:328a:1734:3249]) by smtp.gmail.com with ESMTPSA id n17-20020a1c7211000000b003dc3f07c876sm13260932wmc.46.2023.01.31.05.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 05:22:04 -0800 (PST) From: Arthur Cohen To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Philip Herron Subject: [COMMITTED] gccrs: Unit structs are not concrete when they need substitutions Date: Tue, 31 Jan 2023 14:25:50 +0100 Message-Id: <20230131132550.662527-1-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-Spam-Status: No, score=-14.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756545074970602914?= X-GMAIL-MSGID: =?utf-8?q?1756545074970602914?= From: Philip Herron Fixes #1518 gcc/rust/ChangeLog: * typecheck/rust-tyty.h: Fix `is_concrete` for unit types with substitutions. Tested on x86_64-pc-linux-gnu, committed on master. --- 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 ())