-
Notifications
You must be signed in to change notification settings - Fork 13.3k
indirect-const-stabilize the exact_div
intrinsic
#139163
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
Conversation
Hello lang folks! I propose we const-stabilize the This is the equivalent of It was originally added in #61885 for use converting the byte instance between pointers in the slice iterator to item differences, since an iterator over It's coming up now because I think we should just stabilize it, even if libs decides to change that implementation, because it's not a big deal to allow in const. Everything it can do could be done with And it would be legal to implement it as just @rfcbot fcp merge |
Team member @scottmcm has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
FWIW, we don't yet have confirmation whether |
@@ -2786,6 +2786,7 @@ pub const fn carrying_mul_add<T: ~const fallback::CarryingMulAdd<Unsigned = U>, | |||
/// `x % y != 0` or `y == 0` or `x == T::MIN && y == -1` | |||
/// | |||
/// This intrinsic does not have a stable counterpart. | |||
#[rustc_intrinsic_const_stable_indirect] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this, you should be able to remove the rustc_const_unstable
from the slice_as_chunks
methods. (They will still remain unstable due to #[unstable]
.)
Doing so is a good conformation to ensure there's nothing else preventing their const stabilization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good point! Thanks!
As usual please Cc @rust-lang/wg-const-eval on const stabilizations. This is a simple intrinsic, acting on immediate values with a clear spec. So no concerns from my side. |
ee4e4f9
to
308d5ae
Compare
All sounds right. @rfcbot reviewed |
LGTM; |
@rfcbot reviewed |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
For tracking purposes, this is resolved now that libs-api redid the FCP in #74985 (comment) -- it includes |
308d5ae
to
56c08d9
Compare
This intrinsic should have a fallback implementation of exactly that, possibly with the assert(a%b), now that fallbacks are possible. |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
@bors r+ rollup |
…enton Rollup of 8 pull requests Successful merges: - rust-lang#139163 (indirect-const-stabilize the `exact_div` intrinsic) - rust-lang#139276 (Revert "Disable `f16` on Aarch64 without `neon`") - rust-lang#139315 (Switch `time` to `jiff` for time formatting in ICE dumps) - rust-lang#139382 (Update windows-bindgen to 0.61.0) - rust-lang#139688 (rustdoc-search: add unbox flag to Result aliases) - rust-lang#139701 (docs: clarify uint exponent for `is_power_of_two`) - rust-lang#139705 (Removed outdated ui test suite README, give reasons for disabled tests) - rust-lang#139713 (Fix typo in documentation) r? `@ghost` `@rustbot` modify labels: rollup
…enton Rollup of 8 pull requests Successful merges: - rust-lang#139163 (indirect-const-stabilize the `exact_div` intrinsic) - rust-lang#139276 (Revert "Disable `f16` on Aarch64 without `neon`") - rust-lang#139315 (Switch `time` to `jiff` for time formatting in ICE dumps) - rust-lang#139382 (Update windows-bindgen to 0.61.0) - rust-lang#139688 (rustdoc-search: add unbox flag to Result aliases) - rust-lang#139701 (docs: clarify uint exponent for `is_power_of_two`) - rust-lang#139705 (Removed outdated ui test suite README, give reasons for disabled tests) - rust-lang#139713 (Fix typo in documentation) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#139163 - scottmcm:stabilize-exact_div, r=RalfJung indirect-const-stabilize the `exact_div` intrinsic See rust-lang#74985 (comment)
…lfJung indirect-const-stabilize the `exact_div` intrinsic See rust-lang#74985 (comment)
See #74985 (comment)