about summary refs log tree commit diff
path: root/library/core/src/num
diff options
context:
space:
mode:
authorfrectonz <fraol0912@gmail.com>2024-11-03 18:19:44 +0300
committerfrectonz <fraol0912@gmail.com>2024-11-03 18:19:44 +0300
commit9d66cfaa08aaf2615242275a7271cada8344f5cf (patch)
tree1f55373f18287503fac3c30cb3d41d3b53301389 /library/core/src/num
parentdb034cee00570a9b82ea8b9e9e95221dbd745698 (diff)
Modify `NonZero` documentation to reference the underlying integer type
This change updates the documentation for `NonZero` integer types to
explicitly reference the underlying integer type each `NonZero` variant
wraps, instead of  using a general "integer" term.
Diffstat (limited to 'library/core/src/num')
-rw-r--r--library/core/src/num/nonzero.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs
index e2560f48e59..c056a1ced3c 100644
--- a/library/core/src/num/nonzero.rs
+++ b/library/core/src/num/nonzero.rs
@@ -458,7 +458,15 @@ macro_rules! nonzero_integer {
         reversed = $reversed:literal,
         leading_zeros_test = $leading_zeros_test:expr,
     ) => {
-        /// An integer that is known not to equal zero.
+        #[doc = sign_dependent_expr!{
+            $signedness ?
+            if signed {
+                concat!("An [`", stringify!($Int), "`] that is known not to equal zero.")
+            }
+            if unsigned {
+                concat!("A [`", stringify!($Int), "`] that is known not to equal zero.")
+            }
+        }]
         ///
         /// This enables some memory layout optimization.
         #[doc = concat!("For example, `Option<", stringify!($Ty), ">` is the same size as `", stringify!($Int), "`:")]