]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Recognize rustc_args_required_const attribute
authorOwen Avery <powerboat9.gamer@gmail.com>
Sat, 12 Jul 2025 02:47:01 +0000 (22:47 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 5 Aug 2025 14:37:03 +0000 (16:37 +0200)
This doesn't handle rustc_args_required_const, but it does allow us to
recognize it as a valid attribute.

gcc/rust/ChangeLog:

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

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/util/rust-attribute-values.h
gcc/rust/util/rust-attributes.cc

index 09ef566479531ff645bbadda51e20b129a7cccc0..367044a36c1cab6b707fb54ad9b472281c406d4b 100644 (file)
@@ -89,6 +89,9 @@ public:
   static constexpr auto &TEST = "test";
 
   static constexpr auto &SIMD_TEST = "simd_test";
+
+  static constexpr auto &RUSTC_ARGS_REQUIRED_CONST
+    = "rustc_args_required_const";
 };
 } // namespace Values
 } // namespace Rust
index 273e25c43d30231e4f310ea2260761fe3964268f..c846c2d5c33c818fd713f8496536af4358294e4a 100644 (file)
@@ -88,6 +88,9 @@ static const BuiltinAttrDefinition __definitions[]
 
      {Attrs::RUSTC_LAYOUT_SCALAR_VALID_RANGE_START, CODE_GENERATION},
 
+     // TODO: be careful about calling functions marked with this?
+     {Attrs::RUSTC_ARGS_REQUIRED_CONST, CODE_GENERATION},
+
      {Attrs::PRELUDE_IMPORT, NAME_RESOLUTION},
 
      {Attrs::RUSTC_DIAGNOSTIC_ITEM, STATIC_ANALYSIS},