-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Clean up "const_hack" PRs now that const if/match exists #67627
Comments
Hi, may I give this a go? @rustbot claim |
It's all yours! Let me know if you run into any troubles or need more info. |
Hello! I'm having a bit of trouble cleaning up the functions in num. Specifically, I'm getting I started by reverting the body of
To me, it seemed because
At this point, I reverted marking Looking at the codebase, I saw there exists examples of other const unstable function which are able to call other So, I tried marking What's the (likely obvious 😝 ) detail I'm missing here that's causing this issue? |
rustc_const_stable may never be changed to rustc_const_unstable, that would be a breaking change. If you want to use unstable features in a stable const fn, you need to add a new attribute: |
I adjusted the main post, sorry about that misinformation |
Ahh, you're all good :) Thanks! |
Before we had branches in const fn we added a few hacks to some functions by rewriting them in unreadable ways or removing assertions. We should undo all these hacks. The list of PRs with const hacks is https://github.com/rust-lang/rust/issues?q=label%3Aconst-hack+is%3Aclosed
Most of the time you'll want to revert the diff to the body of any const fn but not undo any other changes that these PRs made. Then you'll need to add
allow_internal_unstable
attributes for theconst_if
feature gate (or whatever other feature gates the compiler tells you to add) in case the const fn is already stable.This issue has been assigned to @jumbatm via this comment.
The text was updated successfully, but these errors were encountered: