Skip to content

Tracking Issue for unbounded_shifts #129375

Open

Description

Feature gate: #![feature(unbounded_shifts)]

This is a tracking issue for ACP 428.

This adds shifts functions to the integer types that ignore type bounds when shifting, with out of range values for the rhs yielding the result of shifting the entire value out (0 for left shifts, and unsigned right shifts, and either 0 or -1 for signed right shifts).

Public API

impl uN{
     pub const fn unbounded_shl(self, rhs: u32) -> Self;
     pub const fn unbounded_shr(self, rhs: u32) -> Self;
}

impl iN{
    pub const fn unbounded_shl(self, rhs: u32) -> Self;
    pub const fn unbounded_shr(self, rhs: u32) -> Self;
}

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: A tracking issue for an RFC or an unstable feature.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions