Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#[unstable] accepts an already-stable language feature #129814

Closed
RalfJung opened this issue Aug 31, 2024 · 3 comments · Fixed by #131567
Closed

#[unstable] accepts an already-stable language feature #129814

RalfJung opened this issue Aug 31, 2024 · 3 comments · Fixed by #131567
Assignees
Labels
A-stability Area: `#[stable]`, `#[unstable]` etc. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@RalfJung
Copy link
Member

RalfJung commented Aug 31, 2024

This should probably not be accepted:

#![feature(staged_api)]
#![stable(feature = "rust_test", since = "1.0.0")]

#[unstable(feature = "arbitrary_enum_discriminant", issue = "42")]
#[rustc_const_unstable(feature = "arbitrary_enum_discriminant", issue = "42")]
const fn my_fun() {}

fn main() {}

arbitrary_enum_discriminant is already stable, so having an unstable function under this feature makes no sense.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 31, 2024
@jieyouxu jieyouxu added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Aug 31, 2024
@CastilloDel
Copy link
Contributor

@rustbot claim

@CastilloDel
Copy link
Contributor

Should we also reject features that don't exist? Right now, this test would fail (because it would compile without problems)

//@ check-fail

#![feature(staged_api)]
#![stable(feature = "rust_test", since = "1.0.0")]

#[unstable(feature = "name_of_a_feature_that_does_not_exist", issue = "42")]
const fn my_fun() {}

fn main() {}

@RalfJung
Copy link
Member Author

RalfJung commented Sep 21, 2024 via email

@jieyouxu jieyouxu added A-stability Area: `#[stable]`, `#[unstable]` etc. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 10, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 12, 2024
…ccepted-features, r=jieyouxu

Emit an error for unstable attributes that reference already stable features

Closes rust-lang#129814
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 12, 2024
…ccepted-features, r=jieyouxu

Emit an error for unstable attributes that reference already stable features

Closes rust-lang#129814
@bors bors closed this as completed in b9e083f Oct 13, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Oct 13, 2024
Rollup merge of rust-lang#131567 - CastilloDel:reject-unstable-with-accepted-features, r=jieyouxu

Emit an error for unstable attributes that reference already stable features

Closes rust-lang#129814
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stability Area: `#[stable]`, `#[unstable]` etc. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants