https://gcc.gnu.org/g:d22a2d15f6d51e58d98e759ccabc478762be987f

commit r16-4843-gd22a2d15f6d51e58d98e759ccabc478762be987f
Author: Owen Avery <[email protected]>
Date:   Wed Jul 2 21:39:10 2025 -0400

    gccrs: Recognize rustc_allow_const_fn_unstable
    
    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]>

Diff:
---
 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 f332f33404aa..3b09e8493d18 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 8df7a82417b8..c305877388d3 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},

Reply via email to