From patchwork Tue Jan 30 12:07:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 194077 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1182216dyb; Tue, 30 Jan 2024 04:26:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IF9JXu+vZb7r8UwVnnBasU70AyXJxM7jujlDNEn3SmlrVfX8eyUZI9nC7hFCzVDdXvR6oP+ X-Received: by 2002:a05:6102:2a56:b0:46b:1195:7125 with SMTP id gt22-20020a0561022a5600b0046b11957125mr4166167vsb.5.1706617596338; Tue, 30 Jan 2024 04:26:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706617596; cv=pass; d=google.com; s=arc-20160816; b=bL/8qA4pEyW0nM3GT0NyiEJXT2YVgdZBLJxYwPooIojRLlRr8g+edUet0azI/b5zxl 90O+R239sIsUa/tsYPKnYtHMgz6TowFIVd0zY3tWcU7yiO/Wo0wlzx7ytE+HtO8olQRA Qdj132q69Ow89rJ50ISbvirXDxeZJEQdAUvKu465vrcY2KhT1pUQ67wg2GeuPq4x38o1 +WKIfGhFheSfTSFwEo94vBBdssX1cToOkTatwgrwWn6lqUYrcTroLBWodnD7yKntJSsi Y/KUZECTpRW0NGodiji+NeHku2xVyk1bPCdXx1K1lAV4PiIxp1RdAL2z0/p81wSPOy+x eanw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=zGSQwzUjaZKBQ14ZBTttX51N4Wpcz1KGCOvrt+VaPHA=; fh=s1GzlUPo1djGkCl3rkRJI30hDOSCVwGp0RAbVwQ8dxQ=; b=JMbEPhydHM8TJfVaCWZFHV++Df6HvzKAZwMylO599SGO/p/1W848WciaCaFNZzZwxm WBwNigSwTlCHQ2vUS+Y2vH6ocWKqni23HAkftW4cCIdBE/z+tTlaftrLTzrjXtj3SBHH QEqINbrlkjpbunSCUty4u/s9vdVMoYLJbYe9Qb03PnVkcvUJXbYNoWd7QS75jYY3aCHM ZYJC0H2t+cNSp6PyOaWHeNcACflYUT1NbNR0LQVYXEsxmzJMB/iafX4HRn0Ed39O06Q0 p9EXgymnHRqc8y3D/NMudMakx66erCwUTL5eqPQNxJ/5qTc/eTp6dMccv/P+wGOkKJRk gp2Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=e5HNvQDx; arc=pass (i=1); 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id u10-20020a05622a14ca00b0042a220f0cacsi9771145qtx.650.2024.01.30.04.26.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:26:36 -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=e5HNvQDx; arc=pass (i=1); 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 D89613861825 for ; Tue, 30 Jan 2024 12:26:33 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 8004C38582A6 for ; Tue, 30 Jan 2024 12:11:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8004C38582A6 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8004C38582A6 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::332 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616724; cv=none; b=O1ZtMafGjUjkFoV/Zi1fuOKbD2v1FGEZf6s0FC64dTREGrKjgKdeqS1S0HyTKJvVJQXXwOZR0n3+ofTYkcIRZeT4oaXq4K2OOw0kh+qfuWOxpnrlBEOZGtDPrPW7ZnbfK7cE6vi2GRFRI9gMQVODpTM0jTjPd0tXBesKlWSY62g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616724; c=relaxed/simple; bh=yVvkHiRzwQKV9Fl7/XGRtedUq79De0jo2gWYu0Uyq4g=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=fJFTpxhHBBRpAeSS1uPSdp8kfXoiWIZABNt0kEkEui1ECZm8CwrgHvfif/hK1oiXXyDv9MH1qDZAa0y3zOhbZYM0dhYKXBIXQEqAnobxl+QkQ7VZlAULjttmkNJ3kFh8QgIxSE0W+FHdiHFDTqWU/fXmS8ltdSF0wI8ArmKv92Y= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40e800461baso52295755e9.3 for ; Tue, 30 Jan 2024 04:11:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1706616690; x=1707221490; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=zGSQwzUjaZKBQ14ZBTttX51N4Wpcz1KGCOvrt+VaPHA=; b=e5HNvQDx3csdSMOE3+pGrMF+nq8DYXRrboNSF2IJnjjFV5aZKRNGm1nLeT9+l0rmSG mBlP/rQJjf/6GQKvMTRKyHANWBlEhGVPEUXxstmNtzYDQuJJZ1OD5hpkPuULIDurjMQ9 GbEqvXMIeA7Cyn6QbDqLwsBlUgf60msshYkG9/+z1hBC7gfzr5/N/O76grJP+A65N0yt q49pwdOhuZm7aeR2dhBK4onB9XtliY+cCksemDzHJoEz1fF5eZTti0keJOR/lk1bRMCv WLNJwAJxeo/l34cikEVZPLFdAtMM8Hh3aNK8EGgB5yqPjL1VqTo2gGyZOogahGoVhAwP 3jhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706616690; x=1707221490; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=zGSQwzUjaZKBQ14ZBTttX51N4Wpcz1KGCOvrt+VaPHA=; b=i0czj8YsLxdRzprkmKGoSPArfkLja9GMoY8Cqa728zYZV8nzqXEt65paePbL1A4Z68 /PTmj1KzYopHNlvKYCkjbkH+wJCVEAdO4ywW+OU5ksfNIDE6hTaoDc5QpckIHOUURxUr s++4oBn2WyNZ211s5lTS932Lt1Ed5fiBD3uHIqd6dhuGbrHT9rsHUuvi7OB4CLJ2OUgT ys4goAnWMwJ6atdLBWlLAPASUmAgJXGFCYlb7RttKq6bXzzQOOnBUVSdORLe5CC90a5B guygKjXCyeGahBbds0IFRrw6xzYEIHo4QjTAGYxSYRzgkMLEs5CsU4hv/MdDTyloyjbL gIzQ== X-Gm-Message-State: AOJu0YzptTcdND7MpmlTb0VYvbJBX2LohuRSyFDzhckSXkmyB/ZPwIjU 4NzaIWXZjw56h7xw9n/tYOnszvDpAjDZ40kYxCelrilqph3VAsAvjSbcU+Lvf2wdynz95wF48iO 5CA== X-Received: by 2002:a5d:4582:0:b0:337:c4c7:97cc with SMTP id p2-20020a5d4582000000b00337c4c797ccmr5807016wrq.33.1706616690103; Tue, 30 Jan 2024 04:11:30 -0800 (PST) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id f9-20020a056000036900b00339307d9d31sm10569894wrf.112.2024.01.30.04.11.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:11:29 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Pierre-Emmanuel Patry Subject: [COMMITTED 054/101] gccrs: Add a regression test for async const functions Date: Tue, 30 Jan 2024 13:07:10 +0100 Message-ID: <20240130121026.807464-57-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20240130121026.807464-2-arthur.cohen@embecosm.com> References: <20240130121026.807464-2-arthur.cohen@embecosm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-14.1 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, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: arthur.cohen@embecosm.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789518252453091295 X-GMAIL-MSGID: 1789518252453091295 From: Pierre-Emmanuel Patry Functions that are both async and const shall be rejected during the AST validation pass. This new test highlight this behavior. gcc/testsuite/ChangeLog: * rust/compile/const_async_function.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/compile/const_async_function.rs | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 gcc/testsuite/rust/compile/const_async_function.rs diff --git a/gcc/testsuite/rust/compile/const_async_function.rs b/gcc/testsuite/rust/compile/const_async_function.rs new file mode 100644 index 00000000000..fb1c4dd4c1d --- /dev/null +++ b/gcc/testsuite/rust/compile/const_async_function.rs @@ -0,0 +1,3 @@ +// { dg-additional-options "-frust-edition=2018" } +const async fn weird_function() {} +// { dg-error "functions cannot be both .const. and .async." "" { target *-*-* } .-1 }