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

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

Open
SimonSapin opened this issue Jan 2, 2019 · 1 comment
Labels
A-const-fn Area: const fn foo(..) {..}. Pure functions which can be applied at compile time. A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@SimonSapin
Copy link
Contributor

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
@SimonSapin SimonSapin added A-diagnostics Area: Messages for errors, warnings, and lints A-const-fn Area: const fn foo(..) {..}. Pure functions which can be applied at compile time. labels Jan 2, 2019
@crlf0710 crlf0710 added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 11, 2020
@kadiwa4
Copy link
Contributor

kadiwa4 commented Feb 26, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-fn Area: const fn foo(..) {..}. Pure functions which can be applied at compile time. A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants