-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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-stabilize the unchecked_{add,sub,mul}
*intrinsics*
#97746
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
(rust-highfive has picked a reviewer for you, use r? to override) |
b8cf2b1
to
d23dee8
Compare
This comment has been minimized.
This comment has been minimized.
r? @oli-obk for const-eval(?) decision here |
d23dee8
to
801334a
Compare
☔ The latest upstream changes (presumably #97873) made this pull request unmergeable. Please resolve the merge conflicts. |
This is only the intrinsics, which aren't exposed anywhere, so I think we can just do this without an FCP. The behaviour of these is well understood, have been implemented for ages, and don't offer any new functionality to `const fn`s -- it would be completely legal for them to be implemented via `wrapping_add`, since we don't promise to catch all UB.
801334a
to
d8198ca
Compare
We have never const-stabilized an intrinsic without also stabilizing a function using it before. As per the big banner at the top of the file, intrinsics need to be signed off by the lang team, and I don't have a good argument for stabilizing it without a const fn that needs it. |
Closing this as per my comment above |
This is only the intrinsics, which aren't exposed anywhere, so I think we can just do this without an FCP.
The behaviour of these is well understood, have been implemented for ages, and don't offer any new functionality to
const fn
s -- it would be completely legal for them to be implemented viawrapping_add
, since we don't promise to catch all UB.(Sending this because I was working on something else where I wanted to use
unchecked_sub
for a length in aconst fn
, and it complained at me.)