File tree 2 files changed +8
-0
lines changed
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,9 @@ macro_rules! int_impl {
107
107
108
108
/// Returns the number of leading zeros in the binary representation of `self`.
109
109
///
110
+ /// Depending on what you're doing with the value, you might also be interested in the
111
+ /// [`ilog2`] function which returns a consistent number, even if the type widens.
112
+ ///
110
113
/// # Examples
111
114
///
112
115
/// Basic usage:
@@ -116,6 +119,7 @@ macro_rules! int_impl {
116
119
///
117
120
/// assert_eq!(n.leading_zeros(), 0);
118
121
/// ```
122
+ #[ doc = concat!( "[`ilog2`]: " , stringify!( $SelfT) , "::ilog2" ) ]
119
123
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
120
124
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
121
125
#[ must_use = "this returns the result of the operation, \
Original file line number Diff line number Diff line change @@ -109,6 +109,9 @@ macro_rules! uint_impl {
109
109
110
110
/// Returns the number of leading zeros in the binary representation of `self`.
111
111
///
112
+ /// Depending on what you're doing with the value, you might also be interested in the
113
+ /// [`ilog2`] function which returns a consistent number, even if the type widens.
114
+ ///
112
115
/// # Examples
113
116
///
114
117
/// Basic usage:
@@ -118,6 +121,7 @@ macro_rules! uint_impl {
118
121
///
119
122
/// assert_eq!(n.leading_zeros(), 2);
120
123
/// ```
124
+ #[ doc = concat!( "[`ilog2`]: " , stringify!( $SelfT) , "::ilog2" ) ]
121
125
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
122
126
#[ rustc_const_stable( feature = "const_math" , since = "1.32.0" ) ]
123
127
#[ must_use = "this returns the result of the operation, \
You can’t perform that action at this time.
0 commit comments