From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 46B673858413 for ; Tue, 30 Jan 2024 12:11:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 46B673858413 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 46B673858413 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-40e72a567eeso56792175e9.0 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=jg75SPxCRDBXtfNrDDpF9QWQqXTB5lMVkWyQN5PRV5ej6heGdlX2Xh8n9ONRGprmZH hMQgMVrET9litGDczVowLokSjF2UCeSxp587Tqq4xSjWGq5N5RTx/jguPZGPfhE94nA2 Ao2TdIp1cjt/gCNEBetzqxf/Ojrnj+SB83ndxbcF9fsiJATP8Srw7cdJBRyyWmpIB3dU nLjiM9cQWdnL0ScpTbBZEgt8CuodmXPSA878MV6KanmUZN/+K5Ue1u+YlYgxyMuHsWEJ ZiOzuKteOnCCxKjFYdVtH+MCrVnVoAWQ60R3s89EyGMz9Q2QqTnuCO7Jm9OFY3Q+k2Bs uBBg== X-Gm-Message-State: AOJu0YzhlN9fX3kvsEedkeWz9dE8KjCwgC51V2CnCgKjvK7WtzgbZ+zP 98Sfvad3rmz2fQk/sivFt1XcgTfZBubWqUAqZ/BOJhgRZvXZhqOwpJN9FKh1Zu3hUgg1ZG9WJPU Mhg== 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> Reply-To: arthur.cohen@embecosm.com MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 } -- 2.42.1