Message ID | 20240207114419.1100894-11-arthur.cohen@embecosm.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp2202698dyb; Wed, 7 Feb 2024 04:51:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHG/5wTgUFK9iRgDsmfQTv92LoR1ukws5ptxIlLtiwlkeHptA6iNnzsAXH1F+g8MREl34Et X-Received: by 2002:a05:620a:165b:b0:785:51a7:3554 with SMTP id c27-20020a05620a165b00b0078551a73554mr5306177qko.1.1707310271434; Wed, 07 Feb 2024 04:51:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707310271; cv=pass; d=google.com; s=arc-20160816; b=Uc+EQ7A2BAEe1AC+rCysqOfHus7lYqiZEZIL1veNLVGwZAtBcG+XDejS851ScwMsP6 mERZ9wGt9BJRqbEo5KBbkuybV1F9DQrtnd60I07s5PKGLeii2VwrkEw+1eNwP1/5T/4C r6H9iX6JhnCMO46IZZYqMxvZDxFE87PT31krszUpIrmS/keJUAtLc4I9v32O5qPUpm8I Cb4N+7LxLiENTe1mBlvBVPY0Hg6sow2nBiqE8Aswoeyr5dsRHYlyeJdZf4ST90rut5QW 7uDlci9jwLBnbBdrYeRwm1pzz3piFuTNklmsxjO+E6ZxeA0FOk4PZFZgP+LHa9eqbL/0 RYgg== 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=w4ZJ5TAyupWZDdna310NCKc1jMfHe6CunIGXb7jkSgM=; fh=TCWGDjevoBSubUxZf38nKmObasl1piax6ZHp2Ha7oc0=; b=HGuLeIA0peD6ZZG55SZLkpK6HjT3Rpw181TJ4mGlfMqrEuVd3SG1LDZfaFlYpIFbEN PemyfnsvAyiAlmgAT/PyNraQPBmXE4q1wZXje4VzHbnEpxfCSRQ/JhtioeRsu/VN7P2o teDg4USEMdVCCL7pRfUuKcDgiVYGY8/xgc3/PYs8Njb8SDlcEPVnACT0nbwBaTz5OwFg tyFtVKVwPY3r6kbyU0qHpUeJW9IXwsdjOIeLKDduvYMPoIfvnnFJy0LcvHX2qvHNkJ4/ 6w1/bMzEsAByTdB2OSaDd+2rPnX2Ftc+68vcnV7+Ot0+MMsxVzPySKmCz10P5fqSCutz OQaw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=NyOc6OV2; 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" X-Forwarded-Encrypted: i=2; AJvYcCVTF78Ibk0fGoGSe+4P3QFDLAjx54IlMZ4Fhit3GTNUdk4pMvUgG4724mKNvaCJbihlyv8xTeACGbRDtn+xxN8vKG3UaA== Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h20-20020a05620a245400b007840da09c34si1058463qkn.484.2024.02.07.04.51.11 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 04:51:11 -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=NyOc6OV2; 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 1EF5D3857C55 for <ouuuleilei@gmail.com>; Wed, 7 Feb 2024 12:51:11 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id 23DC93858028 for <gcc-patches@gcc.gnu.org>; Wed, 7 Feb 2024 12:44:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 23DC93858028 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 23DC93858028 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707309860; cv=none; b=GFJmD+5Jzon2bK6uwIPnqFMVNXtNoudQaXP5FEYh2mK0b6NEdurGOizEZCy3Ynb563BR4GaHwriulh/6fNZDyGVMKwCtFIcT6yE/qtbXBQklzNEHtkV6fkGL4QbkKcwi5qFpYf9Y05tlCX/DwCzvAUOWxE5h8kpmmeIf9idQjOQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707309860; c=relaxed/simple; bh=ZTBIyaGtzv76Evl/R1+h6ExxctgarFOyqdXYYSjSijM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=bA/7OA4sQMx6nIqBOpmC+S+2duKIv5TH5+bDs2nAG/1sUNbVulAb5EGHWR9lPPWOxU5L2MdxVVkOnQw9x6324zQ4eCACVvL3mzOV93uBnz7TIjDgBzPz+sM1cuvdcJaJvS5+f1GWf4NWoTDavqYAXvidlU5KPOs+47oE8pZFvQo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40fc6343bd2so4867645e9.1 for <gcc-patches@gcc.gnu.org>; Wed, 07 Feb 2024 04:44:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1707309849; x=1707914649; 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=w4ZJ5TAyupWZDdna310NCKc1jMfHe6CunIGXb7jkSgM=; b=NyOc6OV2oce4y1x9FMolX0YCRYB2xLTa3D1R05hvxqsWzovwtBqKAPyErg0crUzmGa csjzBJlmliH5KssM/y/qIOVImFUPJQU4BvFEJxR5E0YftSXR8tJPiaJngaLjeh/CAerb SaucUbXNO9+yHZYSioUgsaVjUnmFsuAjsWI+1VGxIlfMA/0L8LWenMV1x/GzIkl+hZg/ Rjlgd+IQjJaqDYWn6ns0qlrfCnSXAt4BxxaTPUc85PTeKM/LoYymn9fwzMb5jlNI7+e1 y7KNm+vd/UwxrFrG7duUHmfoyi/m/KjPe2shjNQZhaZrBHcdLgR7XHUJZFr6aaKWO228 NR3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707309849; x=1707914649; 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=w4ZJ5TAyupWZDdna310NCKc1jMfHe6CunIGXb7jkSgM=; b=D1glaBTmvvsRjvxubWmWg6LxMUrb1yPcw8U5gFL+pGKrZhaDKNSSBaxpcOK8G6cmI+ aCxQSOhC2PxZk0t0QxqhDFapmvs/2HfuJsekzPPMwvInhdP+JlbcUfrMwkETcsVEQ+pH MwcQEPJA8FYOHpsjG0OO1GLcwaYWcpK8kNhatyuHSrEUHsDcqGKpUW8sSlP12EafGMJI qn0CB2iqFVUFUJPfy6XSXakphYyXKEZJ32aMaa59I/kVukQmKzifgv8iVKPqLwtqqATP Ua2Hx6ArQrhVM1t3jgSuwmLN5FSmqrGLyZJ+D+McpDlhw6cGNY9ukheck5lyVUVI/cgn B7rg== X-Gm-Message-State: AOJu0YyODdKvIpoUijU6S9T3rjTjHg0IrX+aK+EG0Nht0YTkz+wZrgBl gVnLf1GV80XrUNIcUWK15TTi7/48M09Ve8Jewb+5JFzMG1nbi3PgIdBqjJy1I/Oyg3Pz08hG+Cq OeQ== X-Received: by 2002:adf:e643:0:b0:33b:1c1e:3e5f with SMTP id b3-20020adfe643000000b0033b1c1e3e5fmr3942745wrn.16.1707309849452; Wed, 07 Feb 2024 04:44:09 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCU9YYGvrUx4SJfvgs1HoSXiR7ZnJAtsWPY5WErEtBeEuHcILeHs0jEu3WnHNDFVFD2QDkF6qchNUCf+A6PbJdnGy6JC49TjmXiFUPub Received: from platypus.sou.embecosm-corp.com ([212.69.42.53]) by smtp.gmail.com with ESMTPSA id x19-20020a05600c2a5300b0040fbdd6f69bsm5044188wme.33.2024.02.07.04.44.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 04:44:08 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Philip Herron <herron.philip@googlemail.com> Subject: [COMMITTED 10/25] gccrs: add testcase to prove issue has already been fixed Date: Wed, 7 Feb 2024 12:43:56 +0100 Message-ID: <20240207114419.1100894-11-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20240207114419.1100894-2-arthur.cohen@embecosm.com> References: <20240207114419.1100894-2-arthur.cohen@embecosm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.4 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=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: 1790244575123633061 X-GMAIL-MSGID: 1790244575123633061 |
Series |
[COMMITTED,01/25] gccrs: Parse normal functions with `self` parameter correctly
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Arthur Cohen
Feb. 7, 2024, 11:43 a.m. UTC
From: Philip Herron <herron.philip@googlemail.com>
Fixes #1483
gcc/testsuite/ChangeLog:
* rust/compile/issue-1483.rs: New test.
---
gcc/testsuite/rust/compile/issue-1483.rs | 28 ++++++++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 gcc/testsuite/rust/compile/issue-1483.rs
diff --git a/gcc/testsuite/rust/compile/issue-1483.rs b/gcc/testsuite/rust/compile/issue-1483.rs new file mode 100644 index 00000000000..eda7e139283 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-1483.rs @@ -0,0 +1,28 @@ +#[lang = "sized"] +pub trait Sized {} + +#[lang = "fn_once"] +pub trait FnOnce<Args> { + #[lang = "fn_once_output"] + type Output; + + extern "rust-call" fn call_once(self, args: Args) -> Self::Output; +} + +pub fn takes_fn_generic<F: FnOnce(i32) -> i32>(a: i32, f: F) -> i32 { + f(a) +} + +pub fn takes_fn_generic_where<F>(a: i32, f: F) -> i32 +where + F: FnOnce(i32) -> i32, +{ + f(a) +} + +pub fn test() { + let foo = |x: i32| -> i32 { x + 1 }; + + takes_fn_generic(1, foo); + takes_fn_generic_where(2, foo); +}