]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Recognize rustc_allow_const_fn_unstable
authorOwen Avery <powerboat9.gamer@gmail.com>
Thu, 3 Jul 2025 01:39:10 +0000 (21:39 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 30 Oct 2025 19:59:05 +0000 (20:59 +0100)
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 <powerboat9.gamer@gmail.com>
gcc/rust/util/rust-attribute-values.h
gcc/rust/util/rust-attributes.cc

index f332f33404aab4bfcbab85a2adcf10cf6cdce384..3b09e8493d18938e4ff5596f5626b96fb57be0f9 100644 (file)
@@ -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";
index 8df7a82417b8e5ddf333c40d4e45dca4f646248d..c305877388d34926b4fc0c3cdcf3189be4e8f629 100644 (file)
@@ -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},