-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Tracking Issue for arithmetic that panics on overflow (strict_* operations) #118260
Copy link
Copy link
Closed
Closed
Copy link
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Milestone
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Feature gate:
#![feature(strict_overflow_ops)]This is a tracking issue for doing arithmetic that is guaranteed to panic on overflow, see the ACP for more details: rust-lang/libs-team#270.
Public API
For both signed and unsigned integers:
Additionally, signed integers have:
And unsigned integers have:
Steps / History
strict_overflow_ops#144682Unresolved Questions
strict_negon unsigned types? It's basically identical toassert_ne!(x, 0).strict_div,strict_rem,strict_div_euclidandstrict_rem_euclidon unsigned types? Those will never panic; they are identical to the non-strict versions.Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩