Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2229014/?format=api
{ "id": 2229014, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2229014/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260427161121.2946-1-gerris.rs@gmail.com/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/1.1/projects/17/?format=api", "name": "GNU Compiler Collection", "link_name": "gcc", "list_id": "gcc-patches.gcc.gnu.org", "list_email": "gcc-patches@gcc.gnu.org", "web_url": null, "scm_url": null, "webscm_url": null }, "msgid": "<20260427161121.2946-1-gerris.rs@gmail.com>", "date": "2026-04-27T16:11:21", "name": "[gccrs,COMMIT] gccrs: Fix ICE cloning trait functions without return types", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "75d83941b584826cf605786667c91996fed10679", "submitter": { "id": 92092, "url": "http://patchwork.ozlabs.org/api/1.1/people/92092/?format=api", "name": null, "email": "gerris.rs@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260427161121.2946-1-gerris.rs@gmail.com/mbox/", "series": [ { "id": 501684, "url": "http://patchwork.ozlabs.org/api/1.1/series/501684/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=501684", "date": "2026-04-27T16:11:21", "name": "[gccrs,COMMIT] gccrs: Fix ICE cloning trait functions without return types", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/501684/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2229014/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2229014/checks/", "tags": {}, "headers": { "Return-Path": "<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=UGYByD8h;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)", "sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=UGYByD8h", "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "sourceware.org; spf=pass smtp.mailfrom=gmail.com", "server2.sourceware.org;\n arc=none smtp.remote-ip=74.125.82.179" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g47ql5tnNz1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 02:12:02 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id BBB3D4BAE7EE\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 16:11:59 +0000 (GMT)", "from mail-dy1-f179.google.com (mail-dy1-f179.google.com\n [74.125.82.179])\n by sourceware.org (Postfix) with ESMTPS id DB3BC4BA2E08\n for <gcc-patches@gcc.gnu.org>; Mon, 27 Apr 2026 16:11:25 +0000 (GMT)", "by mail-dy1-f179.google.com with SMTP id\n 5a478bee46e88-2c15849aa2cso13821525eec.0\n for <gcc-patches@gcc.gnu.org>; Mon, 27 Apr 2026 09:11:25 -0700 (PDT)", "from\n runnervmhkfpo.2b4dycjmhivupb0lganmtm1jpc.dx.internal.cloudapp.net\n ([20.57.198.167]) by smtp.gmail.com with ESMTPSA id\n 5a478bee46e88-2e53ab8b89csm43674082eec.12.2026.04.27.09.11.22\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 27 Apr 2026 09:11:23 -0700 (PDT)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org BBB3D4BAE7EE", "OpenDKIM Filter v2.11.0 sourceware.org DB3BC4BA2E08" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org DB3BC4BA2E08", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org DB3BC4BA2E08", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777306286; cv=none;\n b=PQ19+L3gf9qlWHqvbOlxx4G8J8Y8fMtQ62oFwNaihvwBcuEWHHrzlsOQLsNdCP9DI7otdat77GkwTX15ZZIpRqaIfZaZQr3P+EXqRbl1W/UysUMmQP1ryLkTaYJM7yFMZK8eTASKVUXJXyLP4YhDToMy1FLXOkB8CmjcXwxMREQ=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777306286; c=relaxed/simple;\n bh=nfhCOMpHGN1NnCBtnUf1ibgWaayU2GHEcnJ62fymM/s=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=gEycb4QLyQiCUnFT3K43gCE9C9xTrMXT6tKRZ9MSBe5SwBvVqS7NdlS0w9Ax31hO/4DpUalUJvr7XUeGly3PDqccHX9o525TUAEFSOYKL/qmq4EdZqOmoHDcMAOWC7Whk1oX6hKic5SGLZAbdFvX1P0pfzKR0uKRi+pc4PyIs30=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1777306285; x=1777911085; darn=gcc.gnu.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=0W4n23LLXrPYZPiAMSybiLsoHsC5bS9GVMHCzYLTkAM=;\n b=UGYByD8hNfK4SGI3xJi1lp1daHHIr1fH5QzT/8zaKFpSe4XcluZW9fVLdPJaoiJByD\n 9z2tAsQ48hr4fYY/WlhiVckOdgwebBIYrEA4J42pdKXmlbZuZ5+OMQCcly422GtVDpTE\n Re1YD+bQpexFgSgyvmKjdgHc7yON111gpIfnjXsVuJTQBSH5emx+vLRy7jzrkf+Az6ks\n pF1doARugyAhUG+s7BmZYboXnV7pUMM6HAfWNvaJtoAq1t+DBXk3WdRqbrzYdx+hRs4O\n jjIEiIvSxj2O0smeTUM0/0fClnesMm3c/mMGVPwqRxjxNUHoTI8oRD7Jj76lVaFB35zF\n rSRQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777306285; x=1777911085;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=0W4n23LLXrPYZPiAMSybiLsoHsC5bS9GVMHCzYLTkAM=;\n b=pnhXQgqGv41AiGxl41JYX5lSzYq6XczgLUjJC+qJedQLA3fX2qGAiJYtvBGr6A9Ps9\n olhjP39aaHMPYALo5HmkC5A8I5byut2DzICf2KeabVsk4+240Rko6cQa99zJAkZL2DKg\n rc8tHu23rn7eVqePD7jrcQYJ/hI7qDFCD4pAs7wm1DV7Tvnl5Z1ZBXhTLM4thhrm9OqD\n URrrenS3bO3fAT9OYllRtMY78S6ofw/G2UDP+YlFHjsJ3KKl3aDRf5e/mhI7uzSemOdP\n tRbnYe/FCnJ19256JSLI6eFbvAB59HUFT1YsPK2li9eFy5Kaak2g7+2dwKmPshHEID2G\n aAFw==", "X-Gm-Message-State": "AOJu0YyjPRWAmdqfCNENzwAdl4UKvKcOayV6Q3/HvFrtEzh7ugjl+Jvp\n 9oa5SS6Nbv2pFd0RfX4VDOiuXxm8FogMjtHlleb7UGaU55Q8DnPJgRqcnDEeFQ==", "X-Gm-Gg": "AeBDiesSBA6Iw7KG8fxAmOw/0wbpTUh2z1DA3A8nro06UQ47gL7oP6qgeSjfH3m7Y2Y\n p6kMRIrOHuLbM/vZ0YanA1ikSvl/Qxy4YzemGLZ2x2EWPzgES2Zsd/zAAvns9LzkgBlFeph7FWv\n 5DMqfguAvx+SlS2cLw4+9K31E9o/0WJSxdhScqqldZQx41U/9FS1xGlSyn9WO10r1m2gUGy1Nsb\n QJyZUBRtC8TQl6Vprp9j3PMm6GMOpaIRfWTAduoIto8alYdB0Cxshpc6odUmi+nm1PDlRd6Uejz\n I4/9XHZhyddSSfoJThcjVYfk7nLfs/56/OCVvVChg0mSbht+F11rFoWnOwmQZitryBTJxeTFp3j\n ir+U0JdQ6OgSb2qkaAb/pOtk8CIhK3Hi6t5TZgsXdmeBNykqS+j4FrIIcjC31Ij91zY0C4cUnxx\n hYoJkgdecMcd/Xd/hXxRlK6jO4CdVXZD8TotOqu+rp8Ypj891Ifjrn3qKy/tppyCGogt9gLelbt\n YtoQhrNQuUo5yQlYyZw2Vzdnl++7sJd+uslL8fl+Mc=", "X-Received": "by 2002:a05:7301:1f06:b0:2dd:6937:79d5 with SMTP id\n 5a478bee46e88-2e464dacd7cmr21503901eec.8.1777306284346;\n Mon, 27 Apr 2026 09:11:24 -0700 (PDT)", "From": "gerris.rs@gmail.com", "To": "gcc-patches@gcc.gnu.org,\n\tgcc-rust@gcc.gnu.org", "Cc": "pierre-emmanuel.patry@embecosm.com, arthur.cohen@embecosm.com,\n dkm+gccrs@kataplop.net, lishin <lishin1008@gmail.com>", "Subject": "[gccrs COMMIT] gccrs: Fix ICE cloning trait functions without return\n types", "Date": "Mon, 27 Apr 2026 16:11:21 +0000", "Message-ID": "<20260427161121.2946-1-gerris.rs@gmail.com>", "X-Mailer": "git-send-email 2.43.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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>,\n <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>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>", "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org" }, "content": "From: lishin <lishin1008@gmail.com>\n\nFixes Rust-GCC/gccrs#3972.\n\nTrait functions without an explicit return type can have a null\n`return_type` in `TraitFunctionDecl`. When such declarations are copied,\nthe copy constructor and assignment operator currently try to clone the\nreturn type unconditionally, and this can lead to an ICE.\n\nHandle this case by keeping `nullptr` when there is no return type to\nclone. Also add a regression test for the example from Rust-GCC/gccrs#3972.\n\ngcc/rust/ChangeLog:\n\n\t* hir/tree/rust-hir-item.cc (TraitFunctionDecl::TraitFunctionDecl):\n\tHandle null return types in copy constructor.\n\t(TraitFunctionDecl::operator=): Likewise.\n\ngcc/testsuite/ChangeLog:\n\n\t* rust/compile/issue-3972.rs: New test.\n\nSigned-off-by: lishin <lishin1008@gmail.com>\n---\nThis change was merged into the gccrs repository and is posted here for\nupstream visibility and potential drive-by review, as requested by GCC\nrelease managers.\nEach commit email contains a link to its details on github from where you can\nfind the Pull-Request and associated discussions.\n\n\nCommit on github: https://github.com/Rust-GCC/gccrs/commit/5c4de7f38e474c58dca99aa723199b7b9578aa56\n\nThe commit has been mentioned in the following issue(s):\n - Rust-GCC/gccrs#3972: https://github.com/Rust-GCC/gccrs/issues/3972\n\nThe commit has been mentioned in the following pull-request(s):\n - https://github.com/Rust-GCC/gccrs/pull/4532\n\n gcc/rust/hir/tree/rust-hir-item.cc | 7 +++++--\n gcc/testsuite/rust/compile/issue-3972.rs | 19 +++++++++++++++++++\n 2 files changed, 24 insertions(+), 2 deletions(-)\n create mode 100644 gcc/testsuite/rust/compile/issue-3972.rs\n\n\nbase-commit: 399c14dba6efd5951d95e06bdf402aa6df3f688e", "diff": "diff --git a/gcc/rust/hir/tree/rust-hir-item.cc b/gcc/rust/hir/tree/rust-hir-item.cc\nindex 5e5d9b783..309118cff 100644\n--- a/gcc/rust/hir/tree/rust-hir-item.cc\n+++ b/gcc/rust/hir/tree/rust-hir-item.cc\n@@ -630,7 +630,8 @@ TraitFunctionDecl::TraitFunctionDecl (\n TraitFunctionDecl::TraitFunctionDecl (TraitFunctionDecl const &other)\n : qualifiers (other.qualifiers), function_name (other.function_name),\n function_params (other.function_params),\n- return_type (other.return_type->clone_type ()),\n+ return_type (other.return_type != nullptr ? other.return_type->clone_type ()\n+\t\t\t\t\t : nullptr),\n where_clause (other.where_clause), self (other.self)\n {\n generic_params.reserve (other.generic_params.size ());\n@@ -644,7 +645,9 @@ TraitFunctionDecl::operator= (TraitFunctionDecl const &other)\n function_name = other.function_name;\n qualifiers = other.qualifiers;\n function_params = other.function_params;\n- return_type = other.return_type->clone_type ();\n+ return_type\n+ = other.return_type != nullptr ? other.return_type->clone_type () : nullptr;\n+\n where_clause = other.where_clause;\n self = other.self;\n \ndiff --git a/gcc/testsuite/rust/compile/issue-3972.rs b/gcc/testsuite/rust/compile/issue-3972.rs\nnew file mode 100644\nindex 000000000..466efc364\n--- /dev/null\n+++ b/gcc/testsuite/rust/compile/issue-3972.rs\n@@ -0,0 +1,19 @@\n+// { dg-options \"-frust-compile-until=lowering\" }\n+#![feature(no_core)]\n+#![no_core]\n+\n+struct Expr<const N: u32>;\n+\n+trait Trait0 {\n+ fn required(\n+ _: Expr<\n+ {\n+ trait Trait0 {\n+ fn required();\n+ }\n+\n+ 0\n+ },\n+ >,\n+ );\n+}\n", "prefixes": [ "gccrs", "COMMIT" ] }