Skip to content

Summary issue for const-stabilizing const_int_overflowing #57237

Closed
@Centril

Description

@Centril

In this issue, I propose that we turn methods gated by const_int_overflowing into const fns 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 fns, 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-langRelevant to the language team, which will review and decide on the PR/issue.T-libs-apiRelevant 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.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions