aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Avery <powerboat9.gamer@gmail.com>2025-07-11 22:47:01 -0400
committerArthur Cohen <arthur.cohen@embecosm.com>2025-08-05 16:37:03 +0200
commit95c619976ff94dff1b84a5cff7e65a640d667996 (patch)
tree41c5639f6d8471cd5842a7958f5a488f05e1b24c
parentd2140c7d5c1055e8d371a857b7a2d647cffb5674 (diff)
downloadgcc-95c619976ff94dff1b84a5cff7e65a640d667996.zip
gcc-95c619976ff94dff1b84a5cff7e65a640d667996.tar.gz
gcc-95c619976ff94dff1b84a5cff7e65a640d667996.tar.bz2
gccrs: Recognize rustc_args_required_const attribute
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>
-rw-r--r--gcc/rust/util/rust-attribute-values.h3
-rw-r--r--gcc/rust/util/rust-attributes.cc3
2 files changed, 6 insertions, 0 deletions
diff --git a/gcc/rust/util/rust-attribute-values.h b/gcc/rust/util/rust-attribute-values.h
index 09ef566..367044a 100644
--- a/gcc/rust/util/rust-attribute-values.h
+++ b/gcc/rust/util/rust-attribute-values.h
@@ -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
diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc
index 273e25c..c846c2d 100644
--- a/gcc/rust/util/rust-attributes.cc
+++ b/gcc/rust/util/rust-attributes.cc
@@ -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},