]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
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)
committerCohenArthur <arthur.cohen@embecosm.com>
Thu, 16 Jan 2025 14:00:31 +0000 (14:00 +0000)
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 fa316b45a9e9ef51445211896ef7f0ebeb673930..75dc9e141109b23877aa3ad196dcc2f73df61da2 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 45ebf8c6546119032235b43c8b8236eeaf1aa95c..079e17793db6fd1bd14b0d02648b0e1caefe85e3 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},