Summary issue for const-stabilizing const_int_overflowing
#57237
Labels
disposition-merge
This issue / PR is in PFCP or FCP with a disposition to merge it.
finished-final-comment-period
The final comment period is finished for this PR / Issue.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
In this issue, I propose that we turn methods gated by
const_int_overflowing
intoconst fn
s on stable. These methods include (for every primitive integer type, i.e.{u,i}{8,16,32,64,128,size}
):overflowing_add
overflowing_sub
overflowing_mul
overflowing_shl
overflowing_shr
This proposal depends on #57175 as the above methods use
let
bindings.Stabilization won't proceed until #57175 is stabilized.
Since the methods above are pure arithmetic there should be no reason not to eventually make these into
const fn
s, and since we are gaining that ability, now is as good a time as any.As with other constification proposals for primitive arithmetic (i.e. #57234 and #57105) I've included T-Lang since this affects intrinsics (
add_with_overflow
,sub_with_overflow
, andmul_with_overflow
) and the operational semantics of Rust'sconst fn
fragment. This is the last in a series of constification proposals.To avoid depending on 2 other PRs which will inevitably cause merge conflicts I've avoided creating another PR and will instead do so once FCP nears completion.
The text was updated successfully, but these errors were encountered: