Add a reference to ilog2 in leading_zeros integer docs

Asked in #104248
This commit is contained in:
Albert Larsan 2022-11-10 22:26:10 +01:00
parent 2afca78a0b
commit d85b61460a
No known key found for this signature in database
GPG Key ID: 92709B88BB8F13EA
3 changed files with 11 additions and 5 deletions

View File

@ -107,6 +107,10 @@ macro_rules! int_impl {
/// Returns the number of leading zeros in the binary representation of `self`. /// Returns the number of leading zeros in the binary representation of `self`.
/// ///
/// The
#[doc = concat!("[`", stringify!($SelfTy), "::ilog2()`]")]
/// function returns a consistent number, even if the type widens.
///
/// # Examples /// # Examples
/// ///
/// Basic usage: /// Basic usage:

View File

@ -109,6 +109,10 @@ macro_rules! uint_impl {
/// Returns the number of leading zeros in the binary representation of `self`. /// Returns the number of leading zeros in the binary representation of `self`.
/// ///
/// The
#[doc = concat!("[`", stringify!($SelfTy), "::ilog2()`]")]
/// function returns a consistent number, even if the type widens.
///
/// # Examples /// # Examples
/// ///
/// Basic usage: /// Basic usage:

View File

@ -12,11 +12,9 @@ unset GIT_DIR
ROOT_DIR="$(git rev-parse --show-toplevel)" ROOT_DIR="$(git rev-parse --show-toplevel)"
COMMAND="$ROOT_DIR/x.py test tidy" COMMAND="$ROOT_DIR/x.py test tidy"
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
COMMAND="python $COMMAND" COMMAND="python3.10 $COMMAND"
elif ! command -v python &> /dev/null; then
COMMAND="python3 $COMMAND"
fi
echo "Running pre-push script '$COMMAND'" echo "Running pre-push script '$COMMAND'"