Skip to content

Commit

Permalink
Add a reference to ilog2 in leading_zeros integer docs
Browse files Browse the repository at this point in the history
Asked in #104248
  • Loading branch information
albertlarsan68 committed Nov 10, 2022
1 parent 2afca78 commit d85b614
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions library/core/src/num/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions library/core/src/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 3 additions & 5 deletions src/etc/pre-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'"

Expand Down

0 comments on commit d85b614

Please sign in to comment.