Skip to content

const fn: Missing tracking issue and feature gate name in stability error messages #57261

Description

@SimonSapin

In rustc 1.33.0-nightly (a2b0f24 2018-12-30), compare for example:

error: function pointers in const fn are unstable
 --> a.rs:1:26
  |
1 | const fn foo(x: fn()) -> fn() { x }
  |                          ^^^^

error: aborting due to previous error

… with the error message for some other unstable language feature:

error[E0658]: box expression syntax is experimental; you can call `Box::new` instead. (see issue #49733)
 --> a.rs:1:24
  |
1 | fn foo() -> Box<u32> { box 4 }
  |                        ^^^^^
  |
  = help: add #![feature(box_syntax)] to the crate attributes to enable

error: aborting due to previous error

Activity

  1. added
    C-enhancementCategory: An issue proposing an enhancement or a PR with one.
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Jun 11, 2020
  2. kadiwa4 commented on Feb 26, 2023

    @kadiwa4
    Contributor

    const_fn_fn_ptr_basics has been stabilized in #93827 and no longer emits an error.

  3. added
    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)
    and removed on Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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 lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.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