Feature gate: #![feature(generic_nonzero)]
This is a tracking issue for replacing the distinct NonZero* types with a generic NonZero<T> type. This allows using NonZero with FFI type aliases instead of having weird type names like NonZero_c_ulonglong.
This replaces the following tracking issues:
Public API
use core::num::{NonZero, NonZeroU8};
assert_eq!(NonZero::new(33u8), NonZeroU8::new(33));
Steps / History
Unresolved Questions
Feature gate:
#![feature(generic_nonzero)]This is a tracking issue for replacing the distinct
NonZero*types with a genericNonZero<T>type. This allows usingNonZerowith FFI type aliases instead of having weird type names likeNonZero_c_ulonglong.This replaces the following tracking issues:
NonZerotrait #95157Public API
Steps / History
NonZerotype. #100428NonZero<T>type alias. #119990NonZerotraits. #120160NonZeroalias direction. #120165SelfinNonZero*implementations. #120244NonZeroconstructors generic. #120521transmute_uncheckedinNonZero::new. #120809NonZero::getgeneric. #120563NonZerointernally. #120486NonZerotraits generically. #121241core::convert::num. #121277NonZeroeverywhere inlibrary. #121454NonZeroin tests. #121461ZeroablePrimitivetrait unsafe. #121850NonZerorustc_layout_scalar_valid_range_startattribute to inner type. #121885NonZero. #124230NonZeropost-stabilization changes. #124587Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩