get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2218020/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2218020,
    "url": "http://patchwork.ozlabs.org/api/patches/2218020/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260331094037.3408-4-gerris.rs@gmail.com/",
    "project": {
        "id": 17,
        "url": "http://patchwork.ozlabs.org/api/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,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260331094037.3408-4-gerris.rs@gmail.com>",
    "list_archive_url": null,
    "date": "2026-03-31T09:40:30",
    "name": "[gccrs,COMMIT,04/10] Flatten AttrInputExpr literals to AttrInputLiteral",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "62283ca507f9663eec638c61ff8851bd412f6f29",
    "submitter": {
        "id": 92092,
        "url": "http://patchwork.ozlabs.org/api/people/92092/?format=api",
        "name": null,
        "email": "gerris.rs@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260331094037.3408-4-gerris.rs@gmail.com/mbox/",
    "series": [
        {
            "id": 498158,
            "url": "http://patchwork.ozlabs.org/api/series/498158/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=498158",
            "date": "2026-03-31T09:40:27",
            "name": "[gccrs,COMMIT,01/10] Remove AttrInputMacro attribute input kind",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/498158/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2218020/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2218020/checks/",
    "tags": {},
    "related": [],
    "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=gV4xvKdA;\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=gV4xvKdA",
            "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.171"
        ],
        "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 4flNYK0YWCz1y1q\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 20:46:29 +1100 (AEDT)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 1465D4B7A1EA\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 09:46:27 +0000 (GMT)",
            "from mail-dy1-f171.google.com (mail-dy1-f171.google.com\n [74.125.82.171])\n by sourceware.org (Postfix) with ESMTPS id 0E0724B7A1EF\n for <gcc-patches@gcc.gnu.org>; Tue, 31 Mar 2026 09:40:47 +0000 (GMT)",
            "by mail-dy1-f171.google.com with SMTP id\n 5a478bee46e88-2c66eafc1easo3249248eec.1\n for <gcc-patches@gcc.gnu.org>; Tue, 31 Mar 2026 02:40:46 -0700 (PDT)",
            "from\n runnervmrg6be.i0fnop2thlderixbsj2qpy22md.yx.internal.cloudapp.net\n ([57.151.128.242]) by smtp.gmail.com with ESMTPSA id\n 5a478bee46e88-2c3c796d895sm9175510eec.28.2026.03.31.02.40.43\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 31 Mar 2026 02:40:45 -0700 (PDT)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org 1465D4B7A1EA",
            "OpenDKIM Filter v2.11.0 sourceware.org 0E0724B7A1EF"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 0E0724B7A1EF",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 0E0724B7A1EF",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774950047; cv=none;\n b=RNwBSnfskqQtigQX8Mah4X6sEn+xO4OpqRb7kkBj7TYCt19rfsqjx/omLexcHCoOvaCQ/hdo8JiFBqfQekDwl+yLGEic7WsxsPLPBA6y+IJXilV7ZCkf0kFwoFblXTHwdMdgY7l1a3LCXd82DIvA0Rr3+gJUI0fEAdEgQKaJFQU=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1774950047; c=relaxed/simple;\n bh=1eaTM+Iy7SEpFtKVgOmzQ2AHtOtu37qRRVLzbalmlTo=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=x1zVatkZ0B1ymNlKAjwGJ4IUo7U+l7NvOARKlL2tqF0z4lJBAhRy8ArUU4fEmBhVPTGDE9naXBenNshBYlsaOBTtiIxRLxHaPdiMmjntz0uIUSuzPQEo9ziq0hcOWt2wlWTY5NXO1wZkkdjVYwutwLRHmitBzQ+VK69IanPqsFI=",
        "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=1774950046; x=1775554846; darn=gcc.gnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=fAzthcrSHJTWAtQ+cdAIoqLkthiZK/HmbcYK8Hd/VH0=;\n b=gV4xvKdAi5QZx+jt1uFyZApOnDeGqVMRqLSsbvzioE5+NV+GaJqAd8rYVVZ9NcX5Lu\n lGLG/pzPCtSdNb2LldvELmaQoJFwre0X4N0NNhNOo6PTetZOVz6c8DDkTRE0NRmP/39P\n iONG5kc01PQE1rZ3u3vv7kRMhFovnhsu7LUkiPc+xUm0Lr+MWv4eD36G54C1MGZg0qRq\n Zpeghv0iOUUxssBZ9mSddjhu/Bid3bGV6sM3GyRXxbWEgBIiFNns8WbSlVaM9jeB88kH\n CB82ACk1W+VaNnFqNQ0eeV4aD4ciR8ceHVx9kO8q+T6g22UuIwIelK3BrUcYEsog/7RB\n PzQw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774950046; x=1775554846;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=fAzthcrSHJTWAtQ+cdAIoqLkthiZK/HmbcYK8Hd/VH0=;\n b=YhuZfvltYrHPxA6ICOrYIl1vCa7ETef9xDl3C68V30lfpkco30SILPoi40RbVrCGtj\n uDQBdntMIeoV1HcaAU+bpWJ9cyclk1u3WNDbDv+3hLZnFtxu1SVziXyA81zBxrLWjHF1\n bBnjoB4G450RMZEAf15KYfXman6yDv/uXPJMfk5RVUMzm9PK9yasbO2AfqZhOnEEjZn/\n 3nQYxPsZRF1lQ8r1OIyfugshwpUP+lBzUgUyyFjXm9ScgnZr/r25mJomf+HX3IR8yK7p\n NkQiRyLoXMFlxUfcPaxyBsEefKF2MD45maECwGQDNT3Wad672t5PsJzcLahJbdufX2Lk\n vjqg==",
        "X-Gm-Message-State": "AOJu0YwYNz1R3v8Y77sQ8JAsGJCLOUn5jIGWZCZgRF8+3WT5au8u1naj\n 8DX3mzRgPG8dEErP/NjsIzBIbiPO/d2Yk1LU6rkyyoyLVaxiWXpJlgvhpBWw+Q==",
        "X-Gm-Gg": "ATEYQzxjWPqwiGiC7uWXn2sMatj97tRBnGHcxGs7fMvpIMu/1uIiLhWnUZYELEAGbgT\n cuA9j4DtNCPvfM2JJL68MpzLHcXqtEmOaoFGeIei9HlJ3KYUd8HNWj7ISTzLaF1zc+KdWIOo1A0\n I8v+mtAo+Dk8w4MEVlJmulf0FOYL+AxWw7VcQ4DJDeIrkKpKEIYFPLYLKMkY9UfFwzZkHIOz2Q1\n c9tSq/18kpDetpnXX053bvhVR+98fM6QIUhpZvXwHU+dylcYEandL2IE9hNfco1xKZYawVcaP2b\n KBdIyr/UtJCDmdBFfiaFgA5gcfGVWZoUqlEXpW+ZTV5JpeYRVGmxVtM2wCy7D1Ml8x3XNOEkUlg\n HAeSbs1Lf9wzN4/cbM9Kt+HsNvdm/AmAQUbyEimhd6UlO2XUeg4bD9reYCfWnE2RgEXlIcXdWJe\n 0GwD17qbJjC1NaZp5vR1MD+nLKnfghHIpOqF2HQNT0Ymf2OtyL3gThC97YK++bv8ffz2x5CNxt5\n SwlsT9FOVsa8XchbwEXrfQ=",
        "X-Received": "by 2002:a05:7300:748a:b0:2c5:347:e642 with SMTP id\n 5a478bee46e88-2c50347ea3cmr5442430eec.33.1774950045868;\n Tue, 31 Mar 2026 02:40:45 -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",
        "Subject": "[gccrs COMMIT 04/10] Flatten AttrInputExpr literals to\n AttrInputLiteral",
        "Date": "Tue, 31 Mar 2026 09:40:30 +0000",
        "Message-ID": "<20260331094037.3408-4-gerris.rs@gmail.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260331094037.3408-1-gerris.rs@gmail.com>",
        "References": "<20260331094037.3408-1-gerris.rs@gmail.com>",
        "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: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>\n\nSome macros may be expanded to literals within attribute input. This\nthis means they could be converted to AttrInputLiteral and properly\ndifferentiate both expr and literal in the builtin attribute checker to\nemit an error message when a real expr remains within an attribute.\n\ngcc/rust/ChangeLog:\n\n\t* expand/rust-expand-visitor.cc (ExpandVisitor::visit): Flatten\n\tAttrInputExpr containing a literal to an AttrInputLiteral.\n\t* expand/rust-expand-visitor.h: Add function prototype.\n\nSigned-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.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/002bacdecac0473bd10925efbf1fdf8195b99c3e\n\nThe commit has been mentioned in the following pull-request(s):\n - https://github.com/Rust-GCC/gccrs/pull/4505\n\n gcc/rust/expand/rust-expand-visitor.cc | 18 ++++++++++++++++++\n gcc/rust/expand/rust-expand-visitor.h  |  2 ++\n 2 files changed, 20 insertions(+)",
    "diff": "diff --git a/gcc/rust/expand/rust-expand-visitor.cc b/gcc/rust/expand/rust-expand-visitor.cc\nindex 16786e32e..d03793b42 100644\n--- a/gcc/rust/expand/rust-expand-visitor.cc\n+++ b/gcc/rust/expand/rust-expand-visitor.cc\n@@ -335,6 +335,24 @@ ExpandVisitor::expand_inner_stmts (AST::BlockExpr &expr)\n   expander.pop_context ();\n }\n \n+void\n+ExpandVisitor::visit (AST::Attribute &attr)\n+{\n+  // An attribute input containing a macro may have been expanded to a literal\n+  if (attr.has_attr_input ()\n+      && attr.get_attr_input ().get_attr_input_type ()\n+\t   == AST::AttrInput::AttrInputType::EXPR)\n+    {\n+      auto &expr = static_cast<AST::AttrInputExpr &> (attr.get_attr_input ());\n+      if (expr.get_expr ().is_literal ())\n+\t{\n+\t  auto &lit = static_cast<AST::LiteralExpr &> (expr.get_expr ());\n+\t  attr.set_attr_input (std::make_unique<AST::AttrInputLiteral> (lit));\n+\t}\n+    }\n+  AST::DefaultASTVisitor::visit (attr);\n+}\n+\n void\n ExpandVisitor::maybe_expand_expr (std::unique_ptr<AST::Expr> &expr)\n {\ndiff --git a/gcc/rust/expand/rust-expand-visitor.h b/gcc/rust/expand/rust-expand-visitor.h\nindex d6e48e075..6faf825ae 100644\n--- a/gcc/rust/expand/rust-expand-visitor.h\n+++ b/gcc/rust/expand/rust-expand-visitor.h\n@@ -221,6 +221,8 @@ public:\n   void visit (AST::LifetimeParam &) override;\n   void visit (AST::ConstGenericParam &) override;\n \n+  void visit (AST::Attribute &attribute) override;\n+\n   void visit (AST::MacroInvocation &macro_invoc) override;\n \n   void visit (AST::PathInExpression &path) override;\n",
    "prefixes": [
        "gccrs",
        "COMMIT",
        "04/10"
    ]
}