diff options
| author | Albert Larsan <74931857+albertlarsan68@users.noreply.github.com> | 2022-11-10 22:26:10 +0100 |
|---|---|---|
| committer | Albert Larsan <74931857+albertlarsan68@users.noreply.github.com> | 2022-11-11 00:47:52 +0100 |
| commit | d85b61460aeff77ad149741ea14b80880a2c48a6 (patch) | |
| tree | d1bbc11df15d4bcd7226094ca0ea87d4a3de07b1 | |
| parent | 2afca78a0b03db144c5d8b9f8868feebfe096309 (diff) | |
| download | rust-d85b61460aeff77ad149741ea14b80880a2c48a6.tar.gz rust-d85b61460aeff77ad149741ea14b80880a2c48a6.zip | |
Add a reference to ilog2 in leading_zeros integer docs
Asked in #104248
| -rw-r--r-- | library/core/src/num/int_macros.rs | 4 | ||||
| -rw-r--r-- | library/core/src/num/uint_macros.rs | 4 | ||||
| -rwxr-xr-x | 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 81f050cb283..0f4555a8605 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 93f65c5c7aa..d5c6a5cee98 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 be7de3ebaf5..377e7a9af8b 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'" |
