-
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
Stabilize unchecked_{add,sub,mul}
#122520
Stabilize unchecked_{add,sub,mul}
#122520
Conversation
This comment has been minimized.
This comment has been minimized.
c414a25
to
a148658
Compare
This comment has been minimized.
This comment has been minimized.
a148658
to
e8a337f
Compare
This comment has been minimized.
This comment has been minimized.
e8a337f
to
a0bf6d1
Compare
The Miri subtree was changed cc @rust-lang/miri |
This comment has been minimized.
This comment has been minimized.
a0bf6d1
to
9eb26d7
Compare
This comment has been minimized.
This comment has been minimized.
Finally managed to get through CI 😅 @rustbot ready |
It doesn't look like there's been an FCP for this yet. r=me once that passed, though. @rustbot claim |
@rfcbot fcp merge |
Team member @Amanieu 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! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
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+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (faae5f1): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 667.985s -> 668.88s (0.13%) |
Tracking issue: #85122
I think we might as well just stabilize these basic three. They're the ones that have
nuw
/nsw
flags in LLVM.Notably, this doesn't include the potentially-more-complex or -more-situational things like
unchecked_neg
orunchecked_shr
that are under different feature flags.To quote Ralf #85122 (comment),
Semantially these are already available on stable, even in
const
, viachecked_*
+unreachable_unchecked
. So IMHO we might as well just let people write them directly, rather than try to go through alet Some(x) = x.checked_add(y) else { unsafe { hint::unreachable_unchecked() }};
dance.I added additional text to each method to attempt to better describe the behaviour and encourage
wrapping_*
instead.r? rust-lang/libs-api