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
- Implementation: Create
NonZero
trait with primitive associated type #95155 - Final comment period (FCP)
- Stabilization PR
Unresolved Questions
- Should the associated type be named
Scalar
or something else, such asPrimitive
?