Tracking Issue for unbounded_shifts · Issue #129375 · rust-lang/rust (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@chorman0773

Description

@chorman0773

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

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