Skip to content

Instability warning for let bindings in const fn doesn't list requisite feature flag #57544

Closed
@varkor

Description

@varkor
const fn foo() {
    let _x = 5;
}

reports:

error: local variables in const fn are unstable
 --> src/lib.rs:2:9
  |
2 |     let _x = 5;
  |         ^^

error: aborting due to previous error

This should report to the user which feature flag should be added to use this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions