From: Owen Avery <[email protected]>

This doesn't actually handle the attribute, although it does allow us to
recognize it as valid.

gcc/rust/ChangeLog:

        * util/rust-attribute-values.h
        (Attributes::RUSTC_ALLOW_CONST_FN_UNSTABLE): New static
        constexpr member variable.
        * util/rust-attributes.cc (__definitions): Add entry for
        RUSTC_ALLOW_CONST_FN_UNSTABLE.

Signed-off-by: Owen Avery <[email protected]>
---
 gcc/rust/util/rust-attribute-values.h | 2 ++
 gcc/rust/util/rust-attributes.cc      | 1 +
 2 files changed, 3 insertions(+)

diff --git a/gcc/rust/util/rust-attribute-values.h 
b/gcc/rust/util/rust-attribute-values.h
index f332f33404a..3b09e8493d1 100644
--- a/gcc/rust/util/rust-attribute-values.h
+++ b/gcc/rust/util/rust-attribute-values.h
@@ -60,6 +60,8 @@ public:
   static constexpr auto &RUSTC_PROMOTABLE = "rustc_promotable";
   static constexpr auto &RUSTC_CONST_STABLE = "rustc_const_stable";
   static constexpr auto &RUSTC_CONST_UNSTABLE = "rustc_const_unstable";
+  static constexpr auto &RUSTC_ALLOW_CONST_FN_UNSTABLE
+    = "rustc_allow_const_fn_unstable";
 
   static constexpr auto &RUSTC_SPECIALIZATION_TRAIT
     = "rustc_specialization_trait";
diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc
index 8df7a82417b..c305877388d 100644
--- a/gcc/rust/util/rust-attributes.cc
+++ b/gcc/rust/util/rust-attributes.cc
@@ -103,6 +103,7 @@ static const BuiltinAttrDefinition __definitions[]
      {Attrs::RUSTC_PROMOTABLE, CODE_GENERATION},
      {Attrs::RUSTC_CONST_STABLE, STATIC_ANALYSIS},
      {Attrs::RUSTC_CONST_UNSTABLE, STATIC_ANALYSIS},
+     {Attrs::RUSTC_ALLOW_CONST_FN_UNSTABLE, STATIC_ANALYSIS},
      {Attrs::PRELUDE_IMPORT, NAME_RESOLUTION},
      {Attrs::TRACK_CALLER, CODE_GENERATION},
      {Attrs::RUSTC_SPECIALIZATION_TRAIT, TYPE_CHECK},
-- 
2.50.1

Reply via email to