From dc29897a14cff07f11779574323efb0bbbfb6952 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Fri, 3 Jan 2025 15:45:57 +0000 Subject: [PATCH] attributes: Add #[derive] as a built-in attribute 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 | 1 + gcc/rust/util/rust-attributes.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/gcc/rust/util/rust-attribute-values.h b/gcc/rust/util/rust-attribute-values.h index fa316b45a9e9..75dc9e141109 100644 --- a/gcc/rust/util/rust-attribute-values.h +++ b/gcc/rust/util/rust-attribute-values.h @@ -29,6 +29,7 @@ class Attributes 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"; diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc index 45ebf8c65461..079e17793db6 100644 --- a/gcc/rust/util/rust-attributes.cc +++ b/gcc/rust/util/rust-attributes.cc @@ -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},