PSA: Don't use `#[rustc_deprecated]` ever again

#95960 is set to be merged soon. It removes the #[rustc_deprecated] attribute in its entirety. There are diagnostics to help with the transition for a little bit, but I intend on removing these diagnostics after the next bootstrap.

Just use #[deprecated] like you would in user code. The semantics are now identical to that of #[rustc_deprecated] — the version of Rust will be validated. The only difference that's a breaking change is renaming reason to note, as that's what #[deprecated] uses. If you need to give a suggestion, you can still do this! It's gated under the new #![feature(deprecated_suggestion)] feature, though, because it's also available for end users.

Hopefully this isn't too big of a change for people! If I've missed something, please ping me wherever (here, Zulip, or GitHub), and I'll tend to it as necessary.

10 Likes

I was interested, since it wasn't mentioned, it looks like suggestion is intended to be stabilized? Tracking Issue for `#![feature(deprecated_suggestion)]` · Issue #94785 · rust-lang/rust · GitHub

It hasn't gone through an RFC or anything, but iirc there was general agreement that it would be nice to have for user code in the future.

1 Like