Skip to content

Allow multiple #[unstable] attributes on one item #94770

@m-ou-se

Description

@m-ou-se
Member

We sometimes have things that should be gated by multiple features. E.g. ScopedJoinHandle::is_running is part of scoped_threads, but also of thread_is_running. In these cases we now just apply only one of the #[unstable] attributes, and because of that sometimes accidentally stabilize something when only one of the features gets stabilized.

It'd be great if we could add multiple #[unstable] attributes to a single item. Allowing multiple #[stable] tags isn't a necessity. We could just remove the #[unstable] tag if the feature gets stabilized and there are other #[unstable] tags left. The most important part is that we don't forget about the other unstable tags and don't stabilize something by accident.

Another option would be multiple feature = arguments to #[unstable].

Activity

added
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
E-help-wantedCall for participation: Help is requested to fix this issue.
on Mar 9, 2022
compiler-errors

compiler-errors commented on Mar 15, 2022

@compiler-errors
Member

@rustbot claim

removed their assignment
on Nov 5, 2022
added
E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.
on Nov 5, 2022
added
C-enhancementCategory: An issue proposing an enhancement or a PR with one.
on Dec 3, 2023
dianne

dianne commented on Sep 17, 2024

@dianne
Contributor

I'd like to try picking this back up. Since it's been a while, would the desired design still be the same? Keeping the behavior of the old PR, I think this would allow potentially multiple #[unstable] attributes per item, but at most one #[stable], with no mixing of #[stable] and #[unstable] (and likewise for #[rustc_const_unstable]/#[rustc_const_stable]).
I'm assuming #[rustc_default_body_unstable] should also be able to depend on multiple features in the same way.

dianne

dianne commented on Oct 4, 2024

@dianne
Contributor

@rustbot claim

added
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.
A-stabilityArea: `#[stable]`, `#[unstable]` etc.
and removed
C-enhancementCategory: An issue proposing an enhancement or a PR with one.
on Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-stabilityArea: `#[stable]`, `#[unstable]` etc.C-feature-requestCategory: A feature request, i.e: not implemented / a PR.E-help-wantedCall for participation: Help is requested to fix this issue.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.F-staged_api`#![feature(staged_api)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @Enselic@m-ou-se@compiler-errors@fmease@dianne

    Issue actions

      Allow multiple #[unstable] attributes on one item · Issue #94770 · rust-lang/rust