get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2223286,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2223286/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260414231905.191063-21-arthur.cohen@embecosm.com/",
    "project": {
        "id": 17,
        "url": "http://patchwork.ozlabs.org/api/1.2/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": "<20260414231905.191063-21-arthur.cohen@embecosm.com>",
    "list_archive_url": null,
    "date": "2026-04-14T23:18:42",
    "name": "[COMMITTED,21/43] gccrs: Remove AttrInputMacro attribute input kind",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "6f051b2dd2d94fd13556aca1cb0a0a5a6d13d1a8",
    "submitter": {
        "id": 83476,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/83476/?format=api",
        "name": "Arthur Cohen",
        "email": "arthur.cohen@embecosm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260414231905.191063-21-arthur.cohen@embecosm.com/mbox/",
    "series": [
        {
            "id": 499900,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/499900/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=499900",
            "date": "2026-04-14T23:18:24",
            "name": "[COMMITTED,01/43] gccrs: testsuite:Add a testcase for setup_associated_types",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/499900/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2223286/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2223286/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=embecosm.com header.i=@embecosm.com header.a=rsa-sha256\n header.s=google header.b=Ci6y3o6E;\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=embecosm.com header.i=@embecosm.com header.a=rsa-sha256\n header.s=google header.b=Ci6y3o6E",
            "sourceware.org;\n dmarc=none (p=none dis=none) header.from=embecosm.com",
            "sourceware.org; spf=pass smtp.mailfrom=embecosm.com",
            "server2.sourceware.org;\n arc=none smtp.remote-ip=209.85.128.49"
        ],
        "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 4fwL1K5N21z1yHM\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 09:23:17 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id C2A7A4BA2E07\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 23:23:15 +0000 (GMT)",
            "from mail-wm1-f49.google.com (mail-wm1-f49.google.com\n [209.85.128.49])\n by sourceware.org (Postfix) with ESMTPS id 35A4B4BA2E0D\n for <gcc-patches@gcc.gnu.org>; Tue, 14 Apr 2026 23:14:40 +0000 (GMT)",
            "by mail-wm1-f49.google.com with SMTP id\n 5b1f17b1804b1-488a29e6110so66403405e9.3\n for <gcc-patches@gcc.gnu.org>; Tue, 14 Apr 2026 16:14:40 -0700 (PDT)",
            "from platypus.localdomain (176-147-231-59.abo.bbox.fr.\n [176.147.231.59]) by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-488f1dd8806sm3325945e9.3.2026.04.14.16.14.37\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 14 Apr 2026 16:14:38 -0700 (PDT)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org C2A7A4BA2E07",
            "OpenDKIM Filter v2.11.0 sourceware.org 35A4B4BA2E0D"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 35A4B4BA2E0D",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 35A4B4BA2E0D",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776208480; cv=none;\n b=idwhTDM5QmCbiDBjpf3cv6N4dZO6WZVWBOonao3WMq6GHh6jAuXYdHAT6QzYvzn98Hrms7RC/46tedzjIGl0s0Umbwi6CgG6I0iPW3dU/E9WaX1YPpePbZKJ79vT0nIy8pC9rclNqPp2zxL11PN6lnGV15OFxoI1rFla275/j2I=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776208480; c=relaxed/simple;\n bh=xPtygMNfM7ts6aWDZPXm0KHv+SD46Um9+7qR6s+z6bU=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=jA9jLW+WDKR4xw8IepbW0mJfOoKUXZZp2PNRtmoKHFdLm3a50Bq6K9KtbAK5i7j5rKyreWD1F15OuWwfxjzLSwnx5uuPD9BJvhjGxjyrCRslSFjTCxw/mBdcAB76iCeXsojAuj2O8UuBd4iwaKPUOQRhVvkDJBNLxZnS0YkSsdw=",
        "ARC-Authentication-Results": "i=1; server2.sourceware.org",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=embecosm.com; s=google; t=1776208479; x=1776813279; 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=B/TQ+IZy+tV7ZyjGnQPQGbj+rsT5KyPZs35yFHoViV8=;\n b=Ci6y3o6EcKGa1PTW+lYJEyPQa8ixpsDlCR+YYox3Unxlz+8x7iJEQibpdsFNKaW16u\n /4r3HOFJqA3kNDjqBmUFS/YvG7H8BuS+WZ8U74/0+/dUc9t/4hg65xL9nkpeXmXsXl7n\n FSXJEGnk+xS7NwaZHOQQXzEJsPRoy97JHmyCxH+Jh/+088fJh0xdmRxO+qgdqXsIM0z0\n IA7EEm5GAzHBGzMup/1QaRQYw4vfw5uhdd2Dc6TKpELj8UUJAQ7WovWcLZSFrw7BmTPp\n 7jfsM2MHJEh/nR9bEyWkZrDAblaJM8np69oia3ZwNk/3UIh3FA530bWnhjJxgsW1Mb8z\n /UKw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776208479; x=1776813279;\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=B/TQ+IZy+tV7ZyjGnQPQGbj+rsT5KyPZs35yFHoViV8=;\n b=D9d54ppsko+MEc1QNMBE8W1kHPmw1dvYp3ETy3OepOJJXIpdnWBteNWtSD4p3NK+xF\n B+rnxpnx577KdpkbXGUXaxkj5UIwvJUdlz+Nakcg6A6fXiYsT3w2LQXIxBxhty5VNFdM\n q2oeno9/HApkxoTww05gc8BorPsfT7KPprlpFPix5ktr8lHukyNYHqn7I4AbetOL7svL\n 3lR4/4Iolx9zIIo/xLXvxKuY0p9spL4ET7lrkFdKzqSK09BWZaeT0Td216RIYruxYQwZ\n Hg0B4l6oe+FqX5qpmmHHpnGRBu/xNMX0VXsfBOtFlwe/qF54eaNw8+mDECrPIWuGsViv\n wjOw==",
        "X-Gm-Message-State": "AOJu0Yxr7Hnc4LfMH4B27uJbTq7MaTOaAXGsptOWY2ja5dKrFbdvqwZa\n UuH7qtyAaJRDo8jE01IDDEj6ZdVrQlTRLRWsqSz6550n/s5gCnChQ1apBkZ6s0ICBkZZI5PwmZq\n lZJYUGg==",
        "X-Gm-Gg": "AeBDies6632a0m1pnc3N1ekFixvwzyTmm50cJ+xw7ildxt0IoR10DgUVb0OjG4353PL\n iZ3igs51HNfeyj3xQ8MitAcDcmhoM0z5lAev3PpN3OnFMLdb/PC/SRRg/q8HzxssNIgAd8Qlu+X\n 0GMw2zs1y+4EuNAITLkFBAIZdk0jFuQwH2BlEDNRmIbrZoCKt1E6xAcMUrz9VVWgN8mcThtFyHZ\n BLobBFIQe4cuK3YLyIE6Z8aqwaWZ0QfVnqgg012qzM3BEuiFAt579pOdoLEF89a6NTsHLvHhsNJ\n 7eBpW8Q4wciHQwaSa1DAivQjU3Lb6dWpkMZGrr5EArxvRL4JyOPsIVLE7PMTh9Y7cR8HuV1H+56\n YVPIOJklRSIF/5HORp8fiqLVPSS5NgC3DEew2fzGbWDR7Bfa3hTBJCKnnlGVf6baCKvJZAc9pER\n fp0jSFurV7QWo2x+5TqqtiZcaYPPwo3K0hJURfoWQqzYzYwWU9pYCbC17/dl9Jel+cOSkA906bg\n 0Mn9cx3XxbpIYRr",
        "X-Received": "by 2002:a05:600c:a11c:b0:487:2671:fb8f with SMTP id\n 5b1f17b1804b1-488d67fa40fmr189962935e9.8.1776208478786;\n Tue, 14 Apr 2026 16:14:38 -0700 (PDT)",
        "From": "arthur.cohen@embecosm.com",
        "To": "gcc-patches@gcc.gnu.org",
        "Cc": "gcc-rust@gcc.gnu.org,\n Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>",
        "Subject": "[COMMITTED 21/43] gccrs: Remove AttrInputMacro attribute input kind",
        "Date": "Wed, 15 Apr 2026 01:18:42 +0200",
        "Message-ID": "<20260414231905.191063-21-arthur.cohen@embecosm.com>",
        "X-Mailer": "git-send-email 2.50.1",
        "In-Reply-To": "<20260414231905.191063-1-arthur.cohen@embecosm.com>",
        "References": "<20260414231905.191063-1-arthur.cohen@embecosm.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\nThis attribute kind is being replaced with AttrInputExpr attributes.\n\ngcc/rust/ChangeLog:\n\n\t* ast/rust-ast-collector.cc (TokenCollector::visit): Remove\n\tAttrInputMacro handling.\n\t* ast/rust-ast-collector.h: Remove function prototype.\n\t* ast/rust-ast-full-decls.h (class AttrInputMacro): Remove forward\n\tdeclaration.\n\t* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Remove function.\n\t* ast/rust-ast-visitor.h: Remove function prototypes.\n\t* ast/rust-ast.cc (Attribute::get_traits_to_derive): Remove handling of\n\tmacros.\n\t(AttrInputMacro::as_string): Remove function.\n\t(AttrInputMacro::AttrInputMacro): Likewise.\n\t(AttrInputMacro::operator=): Likewise.\n\t(AttrInputMacro::accept_vis): Likewise.\n\t* ast/rust-ast.h: Remove MACRO kind.\n\t* ast/rust-expr.h (class AttrInputMacro): Add getter for expr pointer.\n\tRemove AttrInputMacro class.\n\t* expand/rust-derive.h: Remove function prototype.\n\t* expand/rust-expand-visitor.cc (ExpandVisitor::visit): Change function\n\tto AttrInputExpr.\n\t* expand/rust-expand-visitor.h: Update prototype.\n\t* hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Remove function.\n\t* hir/rust-ast-lower-base.h: Remove function prototype.\n\t* parse/rust-parse-impl-attribute.hxx: Parse the attribute content as\n\tAttrInputExpr instead.\n\t* util/rust-attributes.cc (check_doc_attribute): Remove MACRO kind\n\thandling.\n\t(check_export_name_attribute): Remove switch and only handle literals.\n\t(AttributeChecker::visit): Remove function.\n\t* util/rust-attributes.h: Remove function prototype.\n\nSigned-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>\n---\n gcc/rust/ast/rust-ast-collector.cc           | 14 ------\n gcc/rust/ast/rust-ast-collector.h            |  1 -\n gcc/rust/ast/rust-ast-full-decls.h           |  1 -\n gcc/rust/ast/rust-ast-visitor.cc             |  6 ---\n gcc/rust/ast/rust-ast-visitor.h              |  2 -\n gcc/rust/ast/rust-ast.cc                     | 26 -----------\n gcc/rust/ast/rust-ast.h                      |  1 -\n gcc/rust/ast/rust-expr.h                     | 48 +-------------------\n gcc/rust/expand/rust-derive.h                |  1 -\n gcc/rust/expand/rust-expand-visitor.cc       |  4 +-\n gcc/rust/expand/rust-expand-visitor.h        |  2 +-\n gcc/rust/hir/rust-ast-lower-base.cc          |  3 --\n gcc/rust/hir/rust-ast-lower-base.h           |  1 -\n gcc/rust/parse/rust-parse-impl-attribute.hxx |  3 +-\n gcc/rust/util/rust-attributes.cc             | 45 ++++++------------\n gcc/rust/util/rust-attributes.h              |  1 -\n 16 files changed, 20 insertions(+), 139 deletions(-)",
    "diff": "diff --git a/gcc/rust/ast/rust-ast-collector.cc b/gcc/rust/ast/rust-ast-collector.cc\nindex ba4b8aa0b3d..e6072a80bca 100644\n--- a/gcc/rust/ast/rust-ast-collector.cc\n+++ b/gcc/rust/ast/rust-ast-collector.cc\n@@ -176,11 +176,6 @@ TokenCollector::visit (Attribute &attrib)\n \t\tstatic_cast<AttrInputLiteral &> (attrib.get_attr_input ()));\n \t      break;\n \t    }\n-\t  case AST::AttrInput::AttrInputType::MACRO:\n-\t    {\n-\t      visit (static_cast<AttrInputMacro &> (attrib.get_attr_input ()));\n-\t      break;\n-\t    }\n \t  case AST::AttrInput::AttrInputType::EXPR:\n \t    {\n \t      visit (static_cast<AttrInputExpr &> (attrib.get_attr_input ()));\n@@ -903,15 +898,6 @@ TokenCollector::visit (AttrInputLiteral &literal)\n   });\n }\n \n-void\n-TokenCollector::visit (AttrInputMacro &macro)\n-{\n-  describe_node (std::string (\"AttrInputMacro\"), [this, &macro] () {\n-    push (Rust::Token::make (EQUAL, UNDEF_LOCATION));\n-    visit (macro.get_macro ());\n-  });\n-}\n-\n void\n TokenCollector::visit (AttrInputExpr &attr)\n {\ndiff --git a/gcc/rust/ast/rust-ast-collector.h b/gcc/rust/ast/rust-ast-collector.h\nindex af60e9d1f41..6f03f575862 100644\n--- a/gcc/rust/ast/rust-ast-collector.h\n+++ b/gcc/rust/ast/rust-ast-collector.h\n@@ -291,7 +291,6 @@ public:\n   // rust-expr.h\n   void visit (LiteralExpr &expr);\n   void visit (AttrInputLiteral &attr_input);\n-  void visit (AttrInputMacro &attr_input);\n   void visit (AttrInputExpr &attr_input);\n   void visit (MetaItemLitExpr &meta_item);\n   void visit (MetaItemPathExpr &meta_item);\ndiff --git a/gcc/rust/ast/rust-ast-full-decls.h b/gcc/rust/ast/rust-ast-full-decls.h\nindex f90b93145e8..21bb686d4e7 100644\n--- a/gcc/rust/ast/rust-ast-full-decls.h\n+++ b/gcc/rust/ast/rust-ast-full-decls.h\n@@ -77,7 +77,6 @@ class QualifiedPathInType;\n class ExprWithBlock;\n class LiteralExpr;\n class AttrInputLiteral;\n-class AttrInputMacro;\n class MetaItemLitExpr;\n class MetaItemPathExpr;\n class OperatorExpr;\ndiff --git a/gcc/rust/ast/rust-ast-visitor.cc b/gcc/rust/ast/rust-ast-visitor.cc\nindex 66054c7afbd..f7d33ffc44e 100644\n--- a/gcc/rust/ast/rust-ast-visitor.cc\n+++ b/gcc/rust/ast/rust-ast-visitor.cc\n@@ -208,12 +208,6 @@ DefaultASTVisitor::visit (AST::AttrInputLiteral &attr_input)\n   visit (attr_input.get_literal ());\n }\n \n-void\n-DefaultASTVisitor::visit (AST::AttrInputMacro &attr_input)\n-{\n-  visit (attr_input.get_macro ());\n-}\n-\n void\n DefaultASTVisitor::visit (AST::AttrInputExpr &attr_input)\n {\ndiff --git a/gcc/rust/ast/rust-ast-visitor.h b/gcc/rust/ast/rust-ast-visitor.h\nindex 0ad69a453ee..c3ec4362b50 100644\n--- a/gcc/rust/ast/rust-ast-visitor.h\n+++ b/gcc/rust/ast/rust-ast-visitor.h\n@@ -72,7 +72,6 @@ public:\n   // rust-expr.h\n   virtual void visit (LiteralExpr &expr) = 0;\n   virtual void visit (AttrInputLiteral &attr_input) = 0;\n-  virtual void visit (AttrInputMacro &attr_input) = 0;\n   virtual void visit (AttrInputExpr &attr_input) = 0;\n   virtual void visit (MetaItemLitExpr &meta_item) = 0;\n   virtual void visit (MetaItemPathExpr &meta_item) = 0;\n@@ -270,7 +269,6 @@ public:\n   virtual void visit (AST::LiteralExpr &expr) override;\n   virtual void visit (AST::AttrInputLiteral &attr_input) override;\n   virtual void visit (AST::AttrInputExpr &attr_input) override;\n-  virtual void visit (AST::AttrInputMacro &attr_input) override;\n   virtual void visit (AST::MetaItemLitExpr &meta_item) override;\n   virtual void visit (AST::MetaItemPathExpr &meta_item) override;\n   virtual void visit (AST::BorrowExpr &expr) override;\ndiff --git a/gcc/rust/ast/rust-ast.cc b/gcc/rust/ast/rust-ast.cc\nindex 004e2760372..e8897696a47 100644\n--- a/gcc/rust/ast/rust-ast.cc\n+++ b/gcc/rust/ast/rust-ast.cc\n@@ -344,7 +344,6 @@ Attribute::get_traits_to_derive ()\n       break;\n     case AST::AttrInput::TOKEN_TREE:\n     case AST::AttrInput::LITERAL:\n-    case AST::AttrInput::MACRO:\n     case AST::AttrInput::EXPR:\n       rust_unreachable ();\n       break;\n@@ -3377,12 +3376,6 @@ AttrInputExpr::accept_vis (ASTVisitor &vis)\n   vis.visit (*this);\n }\n \n-std::string\n-AttrInputMacro::as_string () const\n-{\n-  return \" = \" + macro->as_string ();\n-}\n-\n /* Override that calls the function recursively on all items contained within\n  * the module. */\n void\n@@ -4314,19 +4307,6 @@ BlockExpr::normalize_tail_expr ()\n     }\n }\n \n-// needed here because \"rust-expr.h\" doesn't include \"rust-macro.h\"\n-AttrInputMacro::AttrInputMacro (const AttrInputMacro &oth)\n-  : macro (oth.macro->clone_macro_invocation_impl ())\n-{}\n-\n-AttrInputMacro &\n-AttrInputMacro::operator= (const AttrInputMacro &oth)\n-{\n-  macro = std::unique_ptr<MacroInvocation> (\n-    oth.macro->clone_macro_invocation_impl ());\n-  return *this;\n-}\n-\n /* Visitor implementations - these are short but inlining can't happen anyway\n  * due to virtual functions and I didn't want to make the ast header includes\n  * any longer than they already are. */\n@@ -4373,12 +4353,6 @@ AttrInputLiteral::accept_vis (ASTVisitor &vis)\n   vis.visit (*this);\n }\n \n-void\n-AttrInputMacro::accept_vis (ASTVisitor &vis)\n-{\n-  vis.visit (*this);\n-}\n-\n void\n MetaItemLitExpr::accept_vis (ASTVisitor &vis)\n {\ndiff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h\nindex b82a8cbd7a7..4a1974d4d9d 100644\n--- a/gcc/rust/ast/rust-ast.h\n+++ b/gcc/rust/ast/rust-ast.h\n@@ -726,7 +726,6 @@ public:\n   {\n     EXPR,\n     LITERAL,\n-    MACRO,\n     META_ITEM,\n     TOKEN_TREE,\n   };\ndiff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h\nindex 1ea5c3a3004..90e4daec413 100644\n--- a/gcc/rust/ast/rust-expr.h\n+++ b/gcc/rust/ast/rust-expr.h\n@@ -204,58 +204,14 @@ public:\n \n   Expr &get_expr () { return *expr; }\n \n+  std::unique_ptr<Expr> &get_expr_ptr () { return expr; }\n+\n   AttrInputExpr *clone_attr_input_impl () const override\n   {\n     return new AttrInputExpr (*this);\n   }\n };\n \n-// Like an AttrInputLiteral, but stores a MacroInvocation\n-class AttrInputMacro : public AttrInput\n-{\n-  std::unique_ptr<MacroInvocation> macro;\n-\n-public:\n-  AttrInputMacro (std::unique_ptr<MacroInvocation> macro)\n-    : macro (std::move (macro))\n-  {}\n-\n-  AttrInputMacro (const AttrInputMacro &oth);\n-\n-  AttrInputMacro (AttrInputMacro &&oth) : macro (std::move (oth.macro)) {}\n-\n-  AttrInputMacro &operator= (const AttrInputMacro &oth);\n-\n-  AttrInputMacro &operator= (AttrInputMacro &&oth)\n-  {\n-    macro = std::move (oth.macro);\n-    return *this;\n-  }\n-\n-  std::string as_string () const override;\n-\n-  void accept_vis (ASTVisitor &vis) override;\n-\n-  // assuming this can't be a cfg predicate\n-  bool check_cfg_predicate (const Session &) const override { return false; }\n-\n-  // assuming this is like AttrInputLiteral\n-  bool is_meta_item () const override { return false; }\n-\n-  std::unique_ptr<MacroInvocation> &get_macro () { return macro; }\n-\n-  AttrInputType get_attr_input_type () const final override\n-  {\n-    return AttrInput::AttrInputType::MACRO;\n-  }\n-\n-protected:\n-  AttrInputMacro *clone_attr_input_impl () const override\n-  {\n-    return new AttrInputMacro (*this);\n-  }\n-};\n-\n /* literal expr only meta item inner - TODO possibly replace with inheritance of\n  * LiteralExpr itself? */\n class MetaItemLitExpr : public MetaItemInner\ndiff --git a/gcc/rust/expand/rust-derive.h b/gcc/rust/expand/rust-derive.h\nindex 1f0662ab2cb..7774c6bac83 100644\n--- a/gcc/rust/expand/rust-derive.h\n+++ b/gcc/rust/expand/rust-derive.h\n@@ -104,7 +104,6 @@ private:\n   virtual void visit (Token &tok) override final{};\n   virtual void visit (DelimTokenTree &delim_tok_tree) override final{};\n   virtual void visit (AttrInputMetaItemContainer &input) override final{};\n-  virtual void visit (AttrInputMacro &expr) override final{};\n   virtual void visit (AttrInputExpr &expr) override final{};\n   virtual void visit (IdentifierExpr &ident_expr) override final{};\n   virtual void visit (Lifetime &lifetime) override final{};\ndiff --git a/gcc/rust/expand/rust-expand-visitor.cc b/gcc/rust/expand/rust-expand-visitor.cc\nindex 690c74bee28..c124f9ab937 100644\n--- a/gcc/rust/expand/rust-expand-visitor.cc\n+++ b/gcc/rust/expand/rust-expand-visitor.cc\n@@ -584,9 +584,9 @@ ExpandVisitor::visit (AST::AttrInputLiteral &)\n {}\n \n void\n-ExpandVisitor::visit (AST::AttrInputMacro &macro)\n+ExpandVisitor::visit (AST::AttrInputExpr &attr_input)\n {\n-  rust_sorry_at (UNDEF_LOCATION, \"macros in attributes not supported\");\n+  reseat (attr_input.get_expr_ptr ());\n }\n \n void\ndiff --git a/gcc/rust/expand/rust-expand-visitor.h b/gcc/rust/expand/rust-expand-visitor.h\nindex 2a3938afe73..d6e48e0757f 100644\n--- a/gcc/rust/expand/rust-expand-visitor.h\n+++ b/gcc/rust/expand/rust-expand-visitor.h\n@@ -231,7 +231,7 @@ public:\n \n   void visit (AST::LiteralExpr &expr) override;\n   void visit (AST::AttrInputLiteral &) override;\n-  void visit (AST::AttrInputMacro &) override;\n+  void visit (AST::AttrInputExpr &) override;\n   void visit (AST::MetaItemLitExpr &) override;\n   void visit (AST::MetaItemPathExpr &) override;\n   void visit (AST::StructExprStruct &expr) override;\ndiff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc\nindex 1fc73152a00..8b2fa5a2f50 100644\n--- a/gcc/rust/hir/rust-ast-lower-base.cc\n+++ b/gcc/rust/hir/rust-ast-lower-base.cc\n@@ -140,9 +140,6 @@ ASTLoweringBase::visit (AST::LiteralExpr &)\n void\n ASTLoweringBase::visit (AST::AttrInputLiteral &)\n {}\n-void\n-ASTLoweringBase::visit (AST::AttrInputMacro &)\n-{}\n \n void\n ASTLoweringBase::visit (AST::AttrInputExpr &)\ndiff --git a/gcc/rust/hir/rust-ast-lower-base.h b/gcc/rust/hir/rust-ast-lower-base.h\nindex 42675c281cf..ff1e51eb21b 100644\n--- a/gcc/rust/hir/rust-ast-lower-base.h\n+++ b/gcc/rust/hir/rust-ast-lower-base.h\n@@ -106,7 +106,6 @@ public:\n   virtual void visit (AST::LiteralExpr &expr) override;\n   virtual void visit (AST::AttrInputLiteral &attr_input) override;\n   virtual void visit (AST::AttrInputExpr &attr_input) override;\n-  virtual void visit (AST::AttrInputMacro &attr_input) override;\n   virtual void visit (AST::MetaItemLitExpr &meta_item) override;\n   virtual void visit (AST::MetaItemPathExpr &meta_item) override;\n   virtual void visit (AST::BorrowExpr &expr) override;\ndiff --git a/gcc/rust/parse/rust-parse-impl-attribute.hxx b/gcc/rust/parse/rust-parse-impl-attribute.hxx\nindex 5c7bd99bf3e..3db1cd5c69e 100644\n--- a/gcc/rust/parse/rust-parse-impl-attribute.hxx\n+++ b/gcc/rust/parse/rust-parse-impl-attribute.hxx\n@@ -314,8 +314,7 @@ Parser<ManagedTokenSource>::parse_attr_input ()\n \t    if (!invoke)\n \t      return Parse::Error::AttrInput::make_bad_macro_invocation ();\n \n-\t    return std::unique_ptr<AST::AttrInput> (\n-\t      new AST::AttrInputMacro (std::move (invoke)));\n+\t    return std::make_unique<AST::AttrInputExpr> (std::move (invoke));\n \t  }\n \n \tAST::Literal::LitType lit_type = AST::Literal::STRING;\ndiff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc\nindex 7c137d06b98..3b6587ffdaa 100644\n--- a/gcc/rust/util/rust-attributes.cc\n+++ b/gcc/rust/util/rust-attributes.cc\n@@ -271,7 +271,6 @@ check_doc_attribute (const AST::Attribute &attribute)\n   switch (attribute.get_attr_input ().get_attr_input_type ())\n     {\n     case AST::AttrInput::LITERAL:\n-    case AST::AttrInput::MACRO:\n     case AST::AttrInput::META_ITEM:\n     case AST::AttrInput::EXPR:\n       break;\n@@ -507,38 +506,26 @@ check_export_name_attribute (const AST::Attribute &attribute)\n       return;\n     }\n \n-  // We don't support the whole extended_key_value_attributes feature, we only\n-  // support a subset for macros. We need to emit an error message when the\n-  // attribute does not contain a macro or a string literal.\n   if (attribute.has_attr_input ())\n     {\n       auto &attr_input = attribute.get_attr_input ();\n-      switch (attr_input.get_attr_input_type ())\n+      if (attr_input.get_attr_input_type ()\n+\t  == AST::AttrInput::AttrInputType::LITERAL)\n \t{\n-\tcase AST::AttrInput::AttrInputType::LITERAL:\n-\t  {\n-\t    auto &literal_expr\n-\t      = static_cast<AST::AttrInputLiteral &> (attr_input)\n-\t\t  .get_literal ();\n-\t    auto lit_type = literal_expr.get_lit_type ();\n-\t    switch (lit_type)\n-\t      {\n-\t      case AST::Literal::LitType::STRING:\n-\t      case AST::Literal::LitType::RAW_STRING:\n-\t      case AST::Literal::LitType::BYTE_STRING:\n-\t\treturn;\n-\t      default:\n-\t\tbreak;\n-\t      }\n-\t    break;\n-\t  }\n-\tcase AST::AttrInput::AttrInputType::MACRO:\n-\t  return;\n-\tdefault:\n-\t  break;\n+\t  auto &literal_expr\n+\t    = static_cast<AST::AttrInputLiteral &> (attr_input).get_literal ();\n+\t  auto lit_type = literal_expr.get_lit_type ();\n+\t  switch (lit_type)\n+\t    {\n+\t    case AST::Literal::LitType::STRING:\n+\t    case AST::Literal::LitType::RAW_STRING:\n+\t    case AST::Literal::LitType::BYTE_STRING:\n+\t      return;\n+\t    default:\n+\t      break;\n+\t    }\n \t}\n     }\n-  rust_error_at (attribute.get_locus (), \"attribute must be a string literal\");\n }\n \n static void\n@@ -642,10 +629,6 @@ void\n AttributeChecker::visit (AST::AttrInputLiteral &)\n {}\n \n-void\n-AttributeChecker::visit (AST::AttrInputMacro &)\n-{}\n-\n void\n AttributeChecker::visit (AST::MetaItemLitExpr &)\n {}\ndiff --git a/gcc/rust/util/rust-attributes.h b/gcc/rust/util/rust-attributes.h\nindex f63f902363c..4bac820120c 100644\n--- a/gcc/rust/util/rust-attributes.h\n+++ b/gcc/rust/util/rust-attributes.h\n@@ -129,7 +129,6 @@ private:\n   // rust-expr.h\n   void visit (AST::LiteralExpr &expr) override;\n   void visit (AST::AttrInputLiteral &attr_input) override;\n-  void visit (AST::AttrInputMacro &attr_input) override;\n   void visit (AST::MetaItemLitExpr &meta_item) override;\n   void visit (AST::MetaItemPathExpr &meta_item) override;\n   void visit (AST::BorrowExpr &expr) override;\n",
    "prefixes": [
        "COMMITTED",
        "21/43"
    ]
}