File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,12 @@ impl_zeroable_primitive!(
111111/// ```
112112///
113113/// [null pointer optimization]: crate::option#representation
114+ ///
115+ /// **Note:** `NonZero<T>` can only be used with standard library primitive integer
116+ /// types (such as u8, i32, etc.). The type parameter T must implement the internal
117+ /// trait `ZeroablePrimitive`, which is currently permanently unstable and cannot be
118+ /// implemented by users. Therefore, you cannot use `NonZero<T>` with your own types,
119+ /// nor can you implement traits for all `NonZero<T>`, only for concrete types.
114120#[ stable( feature = "generic_nonzero" , since = "1.79.0" ) ]
115121#[ repr( transparent) ]
116122#[ rustc_nonnull_optimization_guaranteed]
@@ -1472,7 +1478,7 @@ macro_rules! nonzero_integer_signedness_dependent_methods {
14721478
14731479 /// Returns the smallest power of two greater than or equal to `self`.
14741480 /// Checks for overflow and returns [`None`]
1475- /// if the next power of two is greater than the type’ s maximum value.
1481+ /// if the next power of two is greater than the type' s maximum value.
14761482 /// As a consequence, the result cannot wrap to zero.
14771483 ///
14781484 /// # Examples
You can’t perform that action at this time.
0 commit comments