Tracking Issue for arithmetic that panics on overflow (strict_*
operations)
#118260
Open
1 of 5 tasks
Labels
C-tracking-issue
Category: A tracking issue for an RFC or an unstable feature.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
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
Unresolved Questions
strict_neg
on unsigned types? It's basically identical toassert_ne!(x, 0)
.strict_div
,strict_rem
,strict_div_euclid
andstrict_rem_euclid
on 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 ↩
The text was updated successfully, but these errors were encountered: