Skip to content

Commit 699702f

Browse files
Rollup merge of rust-lang#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** ![image](https://github.com/user-attachments/assets/b13bda82-007b-459c-8b22-e27d79005271) **After** ![image](https://github.com/user-attachments/assets/1d7fadc7-dce3-4b84-9b8f-d2bb81c05eb7)
2 parents 1e8ed90 + 76b866c commit 699702f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

core/src/num/nonzero.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,15 @@ macro_rules! nonzero_integer {
472472
reversed = $reversed:literal,
473473
leading_zeros_test = $leading_zeros_test:expr,
474474
) => {
475-
/// An integer that is known not to equal zero.
475+
#[doc = sign_dependent_expr!{
476+
$signedness ?
477+
if signed {
478+
concat!("An [`", stringify!($Int), "`] that is known not to equal zero.")
479+
}
480+
if unsigned {
481+
concat!("A [`", stringify!($Int), "`] that is known not to equal zero.")
482+
}
483+
}]
476484
///
477485
/// This enables some memory layout optimization.
478486
#[doc = concat!("For example, `Option<", stringify!($Ty), ">` is the same size as `", stringify!($Int), "`:")]

0 commit comments

Comments
 (0)