Skip to content

Missing help when trying to enable stabilized library feature on stable #88802

Closed
@jruderman

Description

@jruderman

Given the following code:

#![feature(discriminant_value)]
fn main() {
    let y = Some(1);
    println!("{:?}", std::mem::discriminant(&y));
}

The current output is:

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/main.rs:1:1
  |
1 | #![feature(discriminant_value)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Ideally the output should look like:

error: ...
help: the feature `discriminant_value` has been stable since 1.21.0 and no longer requires an attribute to enable

(or it could be downgraded from error to warning)

#83722 fixed this for #![feature(min_const_generics)] but not for #![feature(discriminant_value)], somehow

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-stabilityArea: `#[stable]`, `#[unstable]` etc.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.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