From: Owen Avery Date: Thu, 3 Jul 2025 01:39:10 +0000 (-0400) Subject: gccrs: Recognize rustc_allow_const_fn_unstable X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d22a2d15f6d51e58d98e759ccabc478762be987f;p=thirdparty%2Fgcc.git 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 --- 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},