Description
In this issue, I propose that we turn methods gated by const_int_overflowing
into const fn
s on stable. These methods include (for every primitive integer type, i.e. {u,i}{8,16,32,64,128,size}
):
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
, and mul_with_overflow
) and the operational semantics of Rust's const 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.