get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2218071,
    "url": "http://patchwork.ozlabs.org/api/patches/2218071/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260331104730.3162-2-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": "<20260331104730.3162-2-gerris.rs@gmail.com>",
    "list_archive_url": null,
    "date": "2026-03-31T10:47:27",
    "name": "[gccrs,COMMIT,2/5] Reject `default` functions after parsing.",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "6f174831418e809c5e0521375d2dd69cb31a4d54",
    "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/20260331104730.3162-2-gerris.rs@gmail.com/mbox/",
    "series": [
        {
            "id": 498172,
            "url": "http://patchwork.ozlabs.org/api/series/498172/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=498172",
            "date": "2026-03-31T10:47:28",
            "name": "[gccrs,COMMIT,1/5] Add `default` as function qualifier.",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/498172/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2218071/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2218071/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=npH9+qFb;\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=npH9+qFb",
            "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=209.85.210.53"
        ],
        "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 4flPxb534Jz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 21:49:07 +1100 (AEDT)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id D70634B92097\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 10:49:05 +0000 (GMT)",
            "from mail-ot1-f53.google.com (mail-ot1-f53.google.com\n [209.85.210.53])\n by sourceware.org (Postfix) with ESMTPS id BA1954BB58B4\n for <gcc-patches@gcc.gnu.org>; Tue, 31 Mar 2026 10:47:35 +0000 (GMT)",
            "by mail-ot1-f53.google.com with SMTP id\n 46e09a7af769-7d7e5e8c907so3481474a34.0\n for <gcc-patches@gcc.gnu.org>; Tue, 31 Mar 2026 03:47:35 -0700 (PDT)",
            "from\n runnervmrg6be.xariblbjf3ru1nzambwxmzlesd.gx.internal.cloudapp.net\n ([52.173.123.150]) by smtp.gmail.com with ESMTPSA id\n 46e09a7af769-7da0a819880sm7914900a34.22.2026.03.31.03.47.32\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 31 Mar 2026 03:47:33 -0700 (PDT)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org D70634B92097",
            "OpenDKIM Filter v2.11.0 sourceware.org BA1954BB58B4"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org BA1954BB58B4",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org BA1954BB58B4",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774954055; cv=none;\n b=JEXqkBDP/AMtCI286F8LVWO9q6w7zLRDvOX+/xkbHMvOW/srJjgLdouedqFGl0pKqNK2hLeI1yX7y6L2EM8Sn2vQUlZ7MTTIjXiX/D1Kmg3ceLs2XzMKFA79cDXhaA0Ff1FCYjxidEIOXdsssQC8lT+7rMTVEHhJy2tuKTSCif4=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1774954055; c=relaxed/simple;\n bh=Rx8eAEVK1D/IukTNJBJ1tW3YUTB2/L2S0rzKwSOp+3A=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=gnVoO9h801GYTzXuai3BgmBy+of9KGLDkuUTXvF+ig9ykakTluNESqntq76n4c5HZkmZs9+agnjdXW/unJtZZQFFr1f2kwqDHuwm7fzMOsdeH8PXzLNn07AIxkgCkLHjQU7vsnPmXA1KDVGgD+l1vrWlqrqpD/KUQWcHGGqeYhY=",
        "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=1774954055; x=1775558855; 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=y6+WpZ2CGCpeeIflaTpQmcCNqFAHusLrKOK3MMG6d1U=;\n b=npH9+qFbmvSAeoLko5PvHus7oOXhVLy+iXsnTixRiL936NC4vddGECj92XYAyYdOXz\n bE6NvG4wLzxNCfk7DWRpqRgTPjSm/fvcTnr4WOQMbseTeyuYmmJ7iNm9LpXANqevUVOz\n Kkr5NIMaFD1OSA2QWmNtvqsSJkSl3+PewdXvt6aswiA0zLuahxBSpU6qIubG8k9Ejlof\n aoTGgn3AN8mpsdur557TT+7YxCjXCbvRz479GZYk1ZdvMDmOch1sSvrPsuOOgCIJr2wB\n P51xRtKS700q1E44Sym+br0uwEa0KN+ASC5fNkdkd+Fzm3dZpcLbLu+ORg1DH94lQKu2\n YNqg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774954055; x=1775558855;\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=y6+WpZ2CGCpeeIflaTpQmcCNqFAHusLrKOK3MMG6d1U=;\n b=isP+pBXhKvWpD4UBJYRB85xkhTkVARtzCIVTpA76dI2ZvoQCMlloNWRtc3EplqlDL8\n jiuMgMi2fGhfNiSDsi2UXyVECOypQ4AlqO07VaZfXVSTLYt0BLR5MQk33pRUsgfW99Gs\n WxMxTRe8FjnIKpP8fln0N5oCA10KEyY/93MAcCI0JNbkkxkufqgZqff0qWo8y3XPv7vS\n 4CaA344hHe7isJEVaIg4D/zVPf3OCtg5p5OlSPrkJbRCNTg3wUCkKCT3T6y0tGH9GVmd\n WHvn0LD5HORxBiL/SGjRondjeSuqGrf0CgLMWWhafopb/g9TaLZRe6i8PYDvPX5Ujfrd\n 2fEQ==",
        "X-Gm-Message-State": "AOJu0YzjJxpoYLN20qT1V07TVW4WkFRC0oM7HDglwu0LUr2U33lB1iUT\n RUZKWnEbslliqUqqQlc+y+qmg1iofWIPWyr7bKIXUV+TRkccIxZ9OC/YpKDYMkBV",
        "X-Gm-Gg": "ATEYQzwFyq9+cop4Srp2rLm2f2oUxpeLwsIzZQrJXHsnhjA0oWE/MfQFMP8zfQDaC8n\n ShIELlpSWKD3tTqZmjpJHYWV/97xTdvTl5/dymy0yHChc/wzD3+7l3b6P2UsdADGd9f4HrnsETW\n xkXPklvD5C72hlYvnNOpS9kUoAnrhCcfoOnNdPcFkxbNDTjBn/vGbIhgZQ0IWVQOxbLzFsK36e0\n QPzdaAclU9AJLfmZ/oaVyBnTD3+LTLoDYl5htj/wRLWXipf5e8g+WeKOXm6SQw17LTOUmtNZid2\n GZ1VP3om28Ypg/uxEdWnmSo4o0Tx+a581NeLSpio8sbRzDBhblIdjy7JYcwDNNggrOmGnM8VLiy\n /DL0fGriyF0GQ9pSg3tBg18slF2fR4i+S7qIV3qA+cIL2znMWPVyrPwLMKJMfUwlwzvCsbPSbXh\n pwJJrA31vBgSABmKgezplTEc5DBZQyu6LxdPCPe7iapAwBWzB8qLVgleKgtGgRUnVBYy+FqdnEy\n azP5j31JuAeFk47NadiRBo=",
        "X-Received": "by 2002:a05:6830:6d56:b0:7d7:da02:1aa4 with SMTP id\n 46e09a7af769-7d9fadccbcemr8530630a34.1.1774954054902;\n Tue, 31 Mar 2026 03:47:34 -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, Kushal Pal <kushalpal109@gmail.com>",
        "Subject": "[gccrs COMMIT 2/5] Reject `default` functions after parsing.",
        "Date": "Tue, 31 Mar 2026 10:47:27 +0000",
        "Message-ID": "<20260331104730.3162-2-gerris.rs@gmail.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260331104730.3162-1-gerris.rs@gmail.com>",
        "References": "<20260331104730.3162-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: Kushal Pal <kushalpal109@gmail.com>\n\nFunctions with `default` qualifier outside of `impl` blocks should be\nallowed to parse successfully and are later rejected during the\nASTValidation pass.\n\ngcc/rust/ChangeLog:\n\n\t* checks/errors/rust-ast-validation.cc (ASTValidation::visit):\n\tAdd error for functions with `default` qualifier outside of impl\n\tblocks.\n\t* parse/rust-parse-impl.hxx (Parser::parse_item):\n\tAllow parsing of functions with `default` qualifier.\n\t(Parser::parse_vis_item): Likewise.\n\nSigned-off-by: Kushal Pal <kushalpal109@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/8b61c1308a5eec2a45483e9f8c253b3af6710f90\n\nThe commit has been mentioned in the following pull-request(s):\n - https://github.com/Rust-GCC/gccrs/pull/4463\n\n gcc/rust/checks/errors/rust-ast-validation.cc |  5 +++++\n gcc/rust/parse/rust-parse-impl.hxx            | 14 ++++++++------\n 2 files changed, 13 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/gcc/rust/checks/errors/rust-ast-validation.cc b/gcc/rust/checks/errors/rust-ast-validation.cc\nindex 00a49b6da..52831e26e 100644\n--- a/gcc/rust/checks/errors/rust-ast-validation.cc\n+++ b/gcc/rust/checks/errors/rust-ast-validation.cc\n@@ -77,6 +77,11 @@ void\n ASTValidation::visit (AST::Function &function)\n {\n   const auto &qualifiers = function.get_qualifiers ();\n+  if (qualifiers.is_default () && ctx.peek () != Kind::INHERENT_IMPL\n+      && ctx.peek () != Kind::TRAIT_IMPL)\n+    rust_error_at (\n+      function.get_locus (),\n+      \"%<default%> is only allowed on items within %<impl%> blocks\");\n   if (qualifiers.is_async () && qualifiers.is_const ())\n     rust_error_at (function.get_locus (),\n \t\t   \"functions cannot be both %<const%> and %<async%>\");\ndiff --git a/gcc/rust/parse/rust-parse-impl.hxx b/gcc/rust/parse/rust-parse-impl.hxx\nindex 8c60ac382..8820e3555 100644\n--- a/gcc/rust/parse/rust-parse-impl.hxx\n+++ b/gcc/rust/parse/rust-parse-impl.hxx\n@@ -431,10 +431,9 @@ Parser<ManagedTokenSource>::parse_item (bool called_from_statement)\n       else if (t->get_str () == Values::WeakKeywords::DEFAULT\n \t       && lexer.peek_token (1)->get_id () != EXCLAM)\n \t{\n-\t  add_error (Error (t->get_locus (),\n-\t\t\t    \"%qs is only allowed on items within %qs blocks\",\n-\t\t\t    \"default\", \"impl\"));\n-\t  return Parse::Error::Item::make_malformed ();\n+\t  // parse normal functions with `default` qualifier\n+\t  // they will be rejected in ASTValidation pass\n+\t  return parse_vis_item (std::move (outer_attrs));\n \t}\n       else if (is_macro_rules_def (t))\n \t{\n@@ -547,10 +546,13 @@ Parser<ManagedTokenSource>::parse_vis_item (AST::AttrVec outer_attrs)\n \t  return parse_union (std::move (vis), std::move (outer_attrs));\n \t  // or should item switch go straight to parsing union?\n \t}\n-      else\n+      else if (t->get_str () == Values::WeakKeywords::DEFAULT)\n \t{\n-\t  break;\n+\t  // parse normal functions with `default` qualifier they will be\n+\t  // rejected in ASTValidation pass\n+\t  return parse_function (std::move (vis), std::move (outer_attrs));\n \t}\n+      break;\n     case CONST:\n       // lookahead to resolve syntactical production\n       t = lexer.peek_token (1);\n",
    "prefixes": [
        "gccrs",
        "COMMIT",
        "2/5"
    ]
}