gcc/rust/ChangeLog:
* util/rust-attribute-values.h
(Attributes::RUSTC_DEPRECATED): New.
* util/rust-attributes.cc
(__definitions): Add Attributes::RUSTC_DEPRECATED.
gcc/testsuite/ChangeLog:
* rust/compile/deprecated-fn.rs: New test.
Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
static constexpr auto &TARGET_FEATURE = "target_feature";
// From now on, these are reserved by the compiler and gated through
// #![feature(rustc_attrs)]
+ static constexpr auto &RUSTC_DEPRECATED = "rustc_deprecated";
static constexpr auto &RUSTC_INHERIT_OVERFLOW_CHECKS
= "rustc_inherit_overflow_checks";
static constexpr auto &STABLE = "stable";
{Attrs::TARGET_FEATURE, CODE_GENERATION},
// From now on, these are reserved by the compiler and gated through
// #![feature(rustc_attrs)]
+ {Attrs::RUSTC_DEPRECATED, STATIC_ANALYSIS},
{Attrs::RUSTC_INHERIT_OVERFLOW_CHECKS, CODE_GENERATION},
{Attrs::STABLE, STATIC_ANALYSIS}};
--- /dev/null
+#![feature(rustc_attrs)]
+
+#[rustc_deprecated(since = "right now", reason = "a whim")]
+pub fn foo() {}