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

rustc_const_unstable attribute ignored in const promotion #50901

Closed
oli-obk opened this issue May 19, 2018 · 0 comments · Fixed by #50909
Closed

rustc_const_unstable attribute ignored in const promotion #50901

oli-obk opened this issue May 19, 2018 · 0 comments · Fixed by #50909
Labels
A-const-eval Area: Constant evaluation (MIR interpretation) A-const-fn Area: const fn foo(..) {..}. Pure functions which can be applied at compile time. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@oli-obk
Copy link
Contributor

oli-obk commented May 19, 2018

let x: &'static _ = &std::time::Duration::from_millis(42).subsec_millis();

works on nightly but not on beta, because the subsec_millis function wasn't unstably const fn when beta was split off.

@oli-obk oli-obk added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-const-fn Area: const fn foo(..) {..}. Pure functions which can be applied at compile time. C-bug Category: This is a bug. WG-compiler-const A-const-eval Area: Constant evaluation (MIR interpretation) labels May 19, 2018
bors added a commit that referenced this issue May 24, 2018
Enforce stability of const fn in promoteds

r? @eddyb

fixes #50901

what's going on here? Why do we have two promoted computation algorithms?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-eval Area: Constant evaluation (MIR interpretation) A-const-fn Area: const fn foo(..) {..}. Pure functions which can be applied at compile time. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant