-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Tracking Issue for const unreachable_unchecked
#53188
Comments
One cannot do any sort of conditional control flow, so |
@oli-obk the RFC for |
No it makes sense after we have conditional control flow. |
As I understand |
yes. Basically you just need to add the |
Hi, It looks like previous PR is not being worked on currently. I'm working on this and will create a PR soon. |
As mentioned in #76209, this issue should be reopened (to track stablization) |
cc @RalfJung ^ |
After a short discussion on Zulip, it was decided that it's best to wait for I'm subscribed to the |
unreachable_unchecked
…_unchecked, r=oli-obk Stabilize `unreachable_unchecked` as `const fn` Closes rust-lang#53188 This PR stabilizes `core::hint::unreachable_unchecked` as `const fn`. MIRI is able to detect when this method is called. Stabilization was delayed until `const_panic` was stabilized so as to avoid users calling this method in its place (thus resulting in runtime UB). With rust-lang#89508, that is no longer an issue. `@rustbot` label +A-const-eval +A-const-fn +T-lang +S-blocked (not sure why it's T-lang, but that's what the tracking issue is)
…_unchecked, r=oli-obk Stabilize `unreachable_unchecked` as `const fn` Closes rust-lang#53188 This PR stabilizes `core::hint::unreachable_unchecked` as `const fn`. MIRI is able to detect when this method is called. Stabilization was delayed until `const_panic` was stabilized so as to avoid users calling this method in its place (thus resulting in runtime UB). With rust-lang#89508, that is no longer an issue. `@rustbot` label +A-const-eval +A-const-fn +T-lang +S-blocked (not sure why it's T-lang, but that's what the tracking issue is)
…_unchecked, r=oli-obk Stabilize `unreachable_unchecked` as `const fn` Closes rust-lang#53188 This PR stabilizes `core::hint::unreachable_unchecked` as `const fn`. MIRI is able to detect when this method is called. Stabilization was delayed until `const_panic` was stabilized so as to avoid users calling this method in its place (thus resulting in runtime UB). With rust-lang#89508, that is no longer an issue. ``@rustbot`` label +A-const-eval +A-const-fn +T-lang +S-blocked (not sure why it's T-lang, but that's what the tracking issue is)
…_unchecked, r=oli-obk Stabilize `unreachable_unchecked` as `const fn` Closes rust-lang#53188 This PR stabilizes `core::hint::unreachable_unchecked` as `const fn`. MIRI is able to detect when this method is called. Stabilization was delayed until `const_panic` was stabilized so as to avoid users calling this method in its place (thus resulting in runtime UB). With rust-lang#89508, that is no longer an issue. ```@rustbot``` label +A-const-eval +A-const-fn +T-lang +S-blocked (not sure why it's T-lang, but that's what the tracking issue is)
Currently one cannot call
unreachable_unchecked
in constant functions, so one cannot add hints of the form:These types of hints can heavily influence code generation, which can substantially change the performance of
const fn
when they are invoked at run-time.It would be a shame to have to write and call
foo_compile_time
andfoo_run_time
because the code generated forfoo_compile_time
is sub-par.This issue has been assigned to @canova via this comment.
The text was updated successfully, but these errors were encountered: