Skip to content

Tracking Issue for saturating_int_assign_impl #92354

Closed
@kellerkindt

Description

@kellerkindt

Feature gate: #![feature(saturating_int_assign_impl)]

This is a tracking issue for adding basic integer operations to the Saturating Wrapping type:

let mut value = Saturating(2u8);
value += 3u8;
value -= 1u8;
value *= 2u8;
value /= 2u8;
value %= 2u8;
value ^= 255u8;
value |= 123u8;
value &= 2u8;
As well as

See #93208 (comment). No longer within the scope of this feature:

let mut value = Saturating(2u8);
let _: Saturating<u8> = value + 3u8;
let _: Saturating<u8> = value - 1u8;
let _: Saturating<u8> = value * 2u8;
let _: Saturating<u8> = value / 2u8;
let _: Saturating<u8> = value % 2u8;
let _: Saturating<u8> = value ^ 255u8;
let _: Saturating<u8> = value | 123u8;
let _: Saturating<u8> = value & 2u8;

Steps / History

Unresolved Questions

  • Is this reasonable?

An implementation for the Wrapping type is planned as follow up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: 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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions