Skip to content

Tracking Issue for NonZero trait #95157

Closed

Description

Feature gate: #![feature(nonzero_trait)]

This is a tracking issue for adding a NonZero trait to core::num, which includes an associated scalar type and a safety requirement.

Public API

// core::num

pub unsafe trait NonZero: Sealed {
    type Scalar;
}

unsafe impl NonZero for NonZero{U,I}{8,16,32,64,128,size} {
    type Scalar = {u,i}{8,16,32,64,128,size};
}

Steps / History

Unresolved Questions

  • Should the associated type be named Scalar or something else, such as Primitive?
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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions