rust-lang / rust-lang/rust

Tracking Issue for `nonzero_bitwise`

Open
#128,281 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-tracking-issue T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Feature gate: #![feature(nonzero_bitwise)]
ACP: https://github.com/rust-lang/libs-team/issues/413

This is a tracking issue for bitwise and bytewise methods on NonZero. When used on a non-zero integer, these methods result in a non-zero integer, so can take the form fn(self) -> Self.

Public API
// core::num

impl<T> NonZero<T> {
    pub fn reverse_bits(self)  -> Self;
    pub fn rotate_left(self) -> Self;
    pub fn rotate_right(self) -> Self;
    pub fn swap_bytes(self) -> Self;
    pub fn to_be(self) -> Self;
    pub fn to_le(self) -> Self;
    pub fn from_be(x: Self) -> Self;
    pub fn from_le(x: Self) -> Self;
}
Steps / History
  • Implementation: #128282
  • Final comment period (FCP)^1
  • Stabilization PR
Unresolved Questions
  • None yet.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the public API in this tracking issue and review implementation issue #128282. The remaining work is the final comment period and stabilization process for the NonZero bitwise and bytewise methods; consult the linked feature-lifecycle guidance to understand what completion requires.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.