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: 1892837 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=embecosm.com header.i=@embecosm.com header.a=rsa-sha256 header.s=google header.b=e5HNvQDx; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TPPXb4kFWz23gZ for ; Tue, 30 Jan 2024 23:26:07 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9788E385F009 for ; Tue, 30 Jan 2024 12:26:05 +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-Google-Smtp-Source: AGHT+IFGFvuZvSOU4hcOlNdeetoDiWrhvXC0m6eCxusTnx+Hjo8T44+t7D6O8nkyNB9/YXWrgWtBCA== 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+incoming=patchwork.ozlabs.org@gcc.gnu.org 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 }