aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/util
diff options
context:
space:
mode:
authorOwen Avery <powerboat9.gamer@gmail.com>2024-03-26 19:28:53 -0400
committerArthur Cohen <arthur.cohen@embecosm.com>2024-08-01 16:52:29 +0200
commit90ce6ea184f1b94e1bd1c88d4f99a9e055de3d97 (patch)
tree2bbc727e5f041feed6caac5761bb904b2cbd8778 /gcc/rust/util
parentcde7407ec09fce2041f8e55f2408c2a55c0b05fa (diff)
downloadgcc-90ce6ea184f1b94e1bd1c88d4f99a9e055de3d97.zip
gcc-90ce6ea184f1b94e1bd1c88d4f99a9e055de3d97.tar.gz
gcc-90ce6ea184f1b94e1bd1c88d4f99a9e055de3d97.tar.bz2
gccrs: Recognize unstable as a builtin attribute
gcc/rust/ChangeLog: * util/rust-attribute-values.h (Attributes::UNSTABLE): New. * util/rust-attributes.cc (__definitions): Add Attributes::UNSTABLE. gcc/testsuite/ChangeLog: * rust/compile/unstable-fn.rs: New test. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc/rust/util')
-rw-r--r--gcc/rust/util/rust-attribute-values.h1
-rw-r--r--gcc/rust/util/rust-attributes.cc3
2 files changed, 3 insertions, 1 deletions
diff --git a/gcc/rust/util/rust-attribute-values.h b/gcc/rust/util/rust-attribute-values.h
index 04aef99..a8551c0 100644
--- a/gcc/rust/util/rust-attribute-values.h
+++ b/gcc/rust/util/rust-attribute-values.h
@@ -52,6 +52,7 @@ public:
static constexpr auto &RUSTC_INHERIT_OVERFLOW_CHECKS
= "rustc_inherit_overflow_checks";
static constexpr auto &STABLE = "stable";
+ static constexpr auto &UNSTABLE = "unstable";
};
} // namespace Values
} // namespace Rust
diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc
index e10918b..84d1781 100644
--- a/gcc/rust/util/rust-attributes.cc
+++ b/gcc/rust/util/rust-attributes.cc
@@ -60,7 +60,8 @@ static const BuiltinAttrDefinition __definitions[]
// #![feature(rustc_attrs)]
{Attrs::RUSTC_DEPRECATED, STATIC_ANALYSIS},
{Attrs::RUSTC_INHERIT_OVERFLOW_CHECKS, CODE_GENERATION},
- {Attrs::STABLE, STATIC_ANALYSIS}};
+ {Attrs::STABLE, STATIC_ANALYSIS},
+ {Attrs::UNSTABLE, STATIC_ANALYSIS}};
BuiltinAttributeMappings *
BuiltinAttributeMappings::get ()