Skip to content

Tracking Issue for NonZero trait #95157

Closed
@nvzqz

Description

@nvzqz

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?

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