]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: attributes: Add #[derive] as a built-in attribute
authorArthur Cohen <arthur.cohen@embecosm.com>
Fri, 3 Jan 2025 15:45:57 +0000 (15:45 +0000)
committerArthur Cohen <arthur.cohen@embecosm.com>
Fri, 21 Mar 2025 11:56:57 +0000 (12:56 +0100)
gcc/rust/ChangeLog:

* util/rust-attribute-values.h: Declare new attribute value.
* util/rust-attributes.cc: Use it.

gcc/rust/util/rust-attribute-values.h
gcc/rust/util/rust-attributes.cc

index ef01e67dc528d707b2a4cfe8b6797aeaa2f1e6f8..9ef5cc52e81ae0f6f5495f198e1ebebdad9fda31 100644 (file)
@@ -29,6 +29,7 @@ public:
   static constexpr auto &COLD = "cold";
   static constexpr auto &CFG = "cfg";
   static constexpr auto &CFG_ATTR = "cfg_attr";
+  static constexpr auto &DERIVE_ATTR = "derive";
   static constexpr auto &DEPRECATED = "deprecated";
   static constexpr auto &ALLOW = "allow";
   static constexpr auto &ALLOW_INTERNAL_UNSTABLE = "allow_internal_unstable";
index 9f63234112c5b3a68ea32df6217931d02f25c054..03452c75bd8a4b9b777717a9c050a2f81c47b2f4 100644 (file)
@@ -46,6 +46,7 @@ static const BuiltinAttrDefinition __definitions[]
      {Attrs::COLD, CODE_GENERATION},
      {Attrs::CFG, EXPANSION},
      {Attrs::CFG_ATTR, EXPANSION},
+     {Attrs::DERIVE_ATTR, EXPANSION},
      {Attrs::DEPRECATED, STATIC_ANALYSIS},
      {Attrs::ALLOW, STATIC_ANALYSIS},
      {Attrs::ALLOW_INTERNAL_UNSTABLE, STATIC_ANALYSIS},