Support multiple stability attributes on items by dianne · Pull Request #131824 · rust-lang/rust (original) (raw)

Motivation

Many unstable library items require the stabilization of multiple features before they can be stabilized. By allowing them to be annotated with multiple #[unstable] attributes, this prevents their accidental stabilization when some of those features are stabilized, and helps mitigate upgrade pains for unstable toolchain users.

New stability attribute semantics

This is documented in rust-lang/rustc-dev-guide#2128.

New syntactic constraints

Fixes #94770

Based on #94988

PR for a diagnostic formatting change this uses: #132544

Some notes on assumptions I've made and how I've handled them:

This doesn't update any libraries to add additional unstable attributes to items that should have them.