Skip to content

Commit

Permalink
Unrolled build for rust-lang#132563
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
rust-timer authored Nov 4, 2024
2 parents 42188c3 + 9d66cfa commit 326eccf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion library/core/src/num/nonzero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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), "`:")]
Expand Down

0 comments on commit 326eccf

Please sign in to comment.