diff options
| author | Jubilee <workingjubilee@gmail.com> | 2024-11-03 15:24:59 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-03 15:24:59 -0800 |
| commit | 1505997c64c2aa4a3736a4e480ef69dbfaa810da (patch) | |
| tree | 79a313ed751ebf695d11259b0164a4c1fd2a4d95 | |
| parent | cf712a248568b10ccd8d78a7642e6c1fb084ae9c (diff) | |
| parent | 9d66cfaa08aaf2615242275a7271cada8344f5cf (diff) | |
| download | rust-1505997c64c2aa4a3736a4e480ef69dbfaa810da.tar.gz rust-1505997c64c2aa4a3736a4e480ef69dbfaa810da.zip | |
Rollup merge of #132563 - frectonz:master, r=Amanieu
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. **Before**  **After** 
| -rw-r--r-- | library/core/src/num/nonzero.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs index d35d6436f2f..056b4b2d750 100644 --- a/library/core/src/num/nonzero.rs +++ b/library/core/src/num/nonzero.rs @@ -472,7 +472,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), "`:")] |
