Skip to content

Require explicit stabilization of the constness of functions #58775

Closed
@oli-obk

Description

@oli-obk

Right now:

  • if you have an unstable const function and you stabilize it, you automatically stabilize the constness, too.
  • if you have a stable non-const function, adding const to it will automatically stabilize the constness
  • You can opt-out of the stability of the constness of a function via rustc_const_unstable

What's missing is the ability to explicitly mark the constness as stable, just like we have an explicit scheme to mark items as stable. This would prevent accidental stablization of any constness. Not that any has happened so far, but #58750 (comment) made me realize that it's not always easy to gauge the stability of constness.

It might also be helpful if documentation showed since when the constness has been stabilized.

cc @Centril @varkor

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)A-stabilityArea: `#[stable]`, `#[unstable]` etc.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language team, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc 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