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!(
111
111
/// ```
112
112
///
113
113
/// [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.
114
120
#[ stable( feature = "generic_nonzero" , since = "1.79.0" ) ]
115
121
#[ repr( transparent) ]
116
122
#[ rustc_nonnull_optimization_guaranteed]
@@ -1472,7 +1478,7 @@ macro_rules! nonzero_integer_signedness_dependent_methods {
1472
1478
1473
1479
/// Returns the smallest power of two greater than or equal to `self`.
1474
1480
/// 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.
1476
1482
/// As a consequence, the result cannot wrap to zero.
1477
1483
///
1478
1484
/// # Examples
You can’t perform that action at this time.
0 commit comments