File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 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 {
107107
108108 /// Returns the number of leading zeros in the binary representation of `self`.
109109 ///
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+ ///
110113 /// # Examples
111114 ///
112115 /// Basic usage:
@@ -116,6 +119,7 @@ macro_rules! int_impl {
116119 ///
117120 /// assert_eq!(n.leading_zeros(), 0);
118121 /// ```
122+ #[ doc = concat!( "[`ilog2`]: " , stringify!( $SelfT) , "::ilog2" ) ]
119123 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
120124 #[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
121125 #[ 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 {
109109
110110 /// Returns the number of leading zeros in the binary representation of `self`.
111111 ///
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+ ///
112115 /// # Examples
113116 ///
114117 /// Basic usage:
@@ -118,6 +121,7 @@ macro_rules! uint_impl {
118121 ///
119122 /// assert_eq!(n.leading_zeros(), 2);
120123 /// ```
124+ #[ doc = concat!( "[`ilog2`]: " , stringify!( $SelfT) , "::ilog2" ) ]
121125 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
122126 #[ rustc_const_stable( feature = "const_math" , since = "1.32.0" ) ]
123127 #[ must_use = "this returns the result of the operation, \
You can’t perform that action at this time.
0 commit comments