Skip to content

Support multiple #[unstable] features for library item #134319

Closed as duplicate of#94770
@Noratrieb

Description

@Noratrieb

Sometimes a library item is unstable for multiple reasons, for example implementing an unstable trait for an unstable type (in this case it matters less because of impl stability rules being a bit special but it happens in other cases too).

desired example:

#[unstable(feature = "unique_rc_arc", issue = "112566")]
#[unstable(feature = "pin_coerce_unsized_trait", issue = "123430")]
unsafe impl<T: ?Sized, A: Allocator> PinCoerceUnsized for UniqueRc<T, A> {}

This way, when one feature is stabilized, the other unstable attribute is still present, ensuring that it's still unstable (the stable attribute shouldn't be added in that case of course).

User code would then also have to enable all the feature gates to use it (of course for trait impls that doesn't apply again).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-stabilityArea: `#[stable]`, `#[unstable]` etc.C-feature-requestCategory: A feature request, i.e: not implemented / a PR.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

    Development

    No branches or pull requests

    Issue actions