From d85b61460aeff77ad149741ea14b80880a2c48a6 Mon Sep 17 00:00:00 2001 From: Albert Larsan <74931857+albertlarsan68@users.noreply.github.com> Date: Thu, 10 Nov 2022 22:26:10 +0100 Subject: [PATCH] Add a reference to ilog2 in leading_zeros integer docs Asked in #104248 --- library/core/src/num/int_macros.rs | 4 ++++ library/core/src/num/uint_macros.rs | 4 ++++ src/etc/pre-push.sh | 8 +++----- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index 81f050cb283d..0f4555a8605f 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -107,6 +107,10 @@ macro_rules! int_impl { /// 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 /// /// Basic usage: diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index 93f65c5c7aaf..d5c6a5cee987 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -109,6 +109,10 @@ macro_rules! uint_impl { /// 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 /// /// Basic usage: diff --git a/src/etc/pre-push.sh b/src/etc/pre-push.sh index be7de3ebaf57..377e7a9af8b7 100755 --- a/src/etc/pre-push.sh +++ b/src/etc/pre-push.sh @@ -12,11 +12,9 @@ unset GIT_DIR ROOT_DIR="$(git rev-parse --show-toplevel)" COMMAND="$ROOT_DIR/x.py test tidy" -if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then - COMMAND="python $COMMAND" -elif ! command -v python &> /dev/null; then - COMMAND="python3 $COMMAND" -fi + +COMMAND="python3.10 $COMMAND" + echo "Running pre-push script '$COMMAND'"