From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id BF08238582B4 for ; Tue, 30 Jan 2024 12:12:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BF08238582B4 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 BF08238582B4 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::333 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616776; cv=none; b=nKN0DPWX+4GcvxPseyvB8xgb71WqaTllOOuJq9soEcv+QEzFYkm7QjgiIFsGPZmM2JxIDabMxZzJ6oCpqgUmtsDrHoyI7CdhYyJ7XNcESYniNuVUNE1/3Y3dXsP/Y/523uJNG4yvVW1uXQ1lH48yuwyBFmBC9ZtYFtsut9JOHQg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616776; c=relaxed/simple; bh=vGuZogYQZprs3muuw9lexLSUA+ED5TsRF59EvwE6Uic=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=yDnCVVzwjeRU3yUlMvGF0G0E64bxFs36PiXWiww3w9x5gVzhQqrrBKaw6SLHghKAcYmfMZfDBrGsdiHGo19Evk6zVBOKPnO4IpNsPb3IxFksWXR8gtQ2HWxwZAZePANmJG7H2JBw6SiIn51qJ5fFa4rs54zgs1fv65xgBJ4SwiE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40e7e2e04f0so44318205e9.1 for ; Tue, 30 Jan 2024 04:12:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1706616719; x=1707221519; 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=Fr6NPO8uw0iG/mBx4SWdamYfDF+YFH1P+EvCx8X3wH4=; b=XRIZ1bSTJ669Am1AE/kYeX4pRL1i3plgmJmMMIVi9OI11o8u6fcgI/UOzYYWmtRQJD PRsLWW+K2uz4dvjntyEsIyGwaED3N6JELfXJK4s6KcDbTYWaKHqSuI8iVuguudrFdTtN umRPr5VQo6Yw7a24URLDyoJhYpJElATFdOqf2h4b9rVleU3uIjQdsORZxZ0WWPfAXn/D 2Z2bVVZdVXll67l66j4uj+dJSBTcRpdh1rCbcRScMLs1NySpmpSLxDWSoxnZ/wYPvnPE aOCo8NuHnyainFga4YMrGcTonofvVRzsgDzb8wpOLpwnxLLUUScEyq2M4G/y6M/JfsQn 7A4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706616719; x=1707221519; 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=Fr6NPO8uw0iG/mBx4SWdamYfDF+YFH1P+EvCx8X3wH4=; b=QyXwEyMhvZ7iJk8dAhdKttlVMWC6uzq7TeiNQNPBxkeVOk2BNFR+jiQ+2o7aXtzmhN 5SA1n31y4P6pvLSLDgIw5kcx/khabsq9OJr9rDmn+zCxqDC49lpneHlbQBtG2zvZrRnL uqI2Hq7SenTexaFWEvisRagfl5Ot7uCh/NnV1bsFq3BB2vruD3d2f0Ezyn8qRwqg+dHa 5IFtmuTrp83IMMVviHiX7Q4pkStzZC88Q/76wvNYsEG/6latOryZl6IeoAV87JT3xzfq YiZvju3MamoNrj7HEeudVBWlHxsmFLMS4+WNE87QHEzvJiKQtD6XgityceyyJuIxC31/ YkEA== X-Gm-Message-State: AOJu0YykuhZ9F3tMxj9xf3g12HJIPi0DvS3pGbQw4y4YJ7/bhWnJB7W2 NhxuiLg6kZy8SWeZmRlU5+o2BuEof/75ExW0pjpteeUeVGJZXXPCMbXR7oeWLg== X-Google-Smtp-Source: AGHT+IE5S2DXcp5Shst/RsMJRznyb5/bpEEzV0XzMU74pQIZnlc82UfaCS5sUVUUB+n/yWXDK42BUQ== X-Received: by 2002:adf:f982:0:b0:33a:fe6a:482 with SMTP id f2-20020adff982000000b0033afe6a0482mr119280wrr.32.1706616718902; Tue, 30 Jan 2024 04:11:58 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:11:58 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Jakub Dupak Subject: [COMMITTED 098/101] gccrs: Test: check implemented for lifetime handling Date: Tue, 30 Jan 2024 13:07:54 +0100 Message-ID: <20240130121026.807464-101-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.2 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: Jakub Dupak gcc/testsuite/ChangeLog: * rust/compile/for_lifetimes.rs: New test. Signed-off-by: Jakub Dupak --- gcc/testsuite/rust/compile/for_lifetimes.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 gcc/testsuite/rust/compile/for_lifetimes.rs diff --git a/gcc/testsuite/rust/compile/for_lifetimes.rs b/gcc/testsuite/rust/compile/for_lifetimes.rs new file mode 100644 index 00000000000..26469624298 --- /dev/null +++ b/gcc/testsuite/rust/compile/for_lifetimes.rs @@ -0,0 +1,19 @@ +// { dg-additional-options "-frust-compile-until=typecheck" } + +fn function_pointer_as_argument(f: for<'a> fn(&'a i32) -> &'a i32) -> i32 { + 0 +} + +fn function_pointer_as_return() -> for<'a> fn(&'a i32) -> &'a i32 { +} + +// https://doc.rust-lang.org/reference/trait-bounds.html + +trait Fn {} +fn call_on_ref_zero(f: F) where for<'a> F: Fn(&'a i32) {} + +fn call_on_ref_zero2(f: F) where F: for<'a> Fn(&'a i32) {} + +trait Trait<'a, T: 'a> {} + +impl<'a, T> Trait<'a, T> for &'a T {} \ No newline at end of file -- 2.42.1