diff options
| -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, 9 insertions, 7 deletions
diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index 1d20bdddf08..4ae1f3c37eb 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -108,8 +108,7 @@ 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 - #[doc = concat!("[`", stringify!($SelfTy), "::ilog2()`]")] - /// function which returns a consistent number, even if the type widens. + /// [`ilog2`] function which returns a consistent number, even if the type widens. /// /// # Examples /// @@ -120,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, \ diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index e5f8e26f286..cd60e09d880 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -110,8 +110,7 @@ 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 - #[doc = concat!("[`", stringify!($SelfTy), "::ilog2()`]")] - /// function which returns a consistent number, even if the type widens. + /// [`ilog2`] function which returns a consistent number, even if the type widens. /// /// # Examples /// @@ -122,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, \ diff --git a/src/etc/pre-push.sh b/src/etc/pre-push.sh index 377e7a9af8b..be7de3ebaf5 100755 --- a/src/etc/pre-push.sh +++ b/src/etc/pre-push.sh @@ -12,9 +12,11 @@ unset GIT_DIR ROOT_DIR="$(git rev-parse --show-toplevel)" COMMAND="$ROOT_DIR/x.py test tidy" - -COMMAND="python3.10 $COMMAND" - +if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then + COMMAND="python $COMMAND" +elif ! command -v python &> /dev/null; then + COMMAND="python3 $COMMAND" +fi echo "Running pre-push script '$COMMAND'" |
