mirror of https://github.com/rust-lang/rust.git
Rollup merge of #104263 - albertlarsan68:add-ilog2-to-leading-zeroes-docs, r=scottmcm
Add a reference to ilog2 in leading_zeros integer docs Fixes #104248
This commit is contained in:
commit
cd4b3ac379
|
@ -107,6 +107,9 @@ macro_rules! int_impl {
|
|||
|
||||
/// Returns the number of leading zeros in the binary representation of `self`.
|
||||
///
|
||||
/// Depending on what you're doing with the value, you might also be interested in the
|
||||
/// [`ilog2`] function which returns a consistent number, even if the type widens.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Basic usage:
|
||||
|
@ -116,6 +119,7 @@ macro_rules! int_impl {
|
|||
///
|
||||
/// assert_eq!(n.leading_zeros(), 0);
|
||||
/// ```
|
||||
#[doc = concat!("[`ilog2`]: ", stringify!($SelfT), "::ilog2")]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
|
|
|
@ -109,6 +109,9 @@ macro_rules! uint_impl {
|
|||
|
||||
/// Returns the number of leading zeros in the binary representation of `self`.
|
||||
///
|
||||
/// Depending on what you're doing with the value, you might also be interested in the
|
||||
/// [`ilog2`] function which returns a consistent number, even if the type widens.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Basic usage:
|
||||
|
@ -118,6 +121,7 @@ macro_rules! uint_impl {
|
|||
///
|
||||
/// assert_eq!(n.leading_zeros(), 2);
|
||||
/// ```
|
||||
#[doc = concat!("[`ilog2`]: ", stringify!($SelfT), "::ilog2")]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[rustc_const_stable(feature = "const_math", since = "1.32.0")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
|
|
Loading…
Reference in New Issue