@@ -79,7 +79,7 @@ macro_rules! int_impl {
79
79
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
80
80
#[ doc( alias = "popcount" ) ]
81
81
#[ doc( alias = "popcnt" ) ]
82
- #[ inline]
82
+ #[ inline( always ) ]
83
83
pub const fn count_ones( self ) -> u32 { ( self as $UnsignedT) . count_ones( ) }
84
84
85
85
/// Returns the number of zeros in the binary representation of `self`.
@@ -93,7 +93,7 @@ macro_rules! int_impl {
93
93
/// ```
94
94
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
95
95
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
96
- #[ inline]
96
+ #[ inline( always ) ]
97
97
pub const fn count_zeros( self ) -> u32 {
98
98
( !self ) . count_ones( )
99
99
}
@@ -111,7 +111,7 @@ macro_rules! int_impl {
111
111
/// ```
112
112
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
113
113
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
114
- #[ inline]
114
+ #[ inline( always ) ]
115
115
pub const fn leading_zeros( self ) -> u32 {
116
116
( self as $UnsignedT) . leading_zeros( )
117
117
}
@@ -129,7 +129,7 @@ macro_rules! int_impl {
129
129
/// ```
130
130
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
131
131
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
132
- #[ inline]
132
+ #[ inline( always ) ]
133
133
pub const fn trailing_zeros( self ) -> u32 {
134
134
( self as $UnsignedT) . trailing_zeros( )
135
135
}
@@ -147,7 +147,7 @@ macro_rules! int_impl {
147
147
/// ```
148
148
#[ stable( feature = "leading_trailing_ones" , since = "1.46.0" ) ]
149
149
#[ rustc_const_stable( feature = "leading_trailing_ones" , since = "1.46.0" ) ]
150
- #[ inline]
150
+ #[ inline( always ) ]
151
151
pub const fn leading_ones( self ) -> u32 {
152
152
( self as $UnsignedT) . leading_ones( )
153
153
}
@@ -165,7 +165,7 @@ macro_rules! int_impl {
165
165
/// ```
166
166
#[ stable( feature = "leading_trailing_ones" , since = "1.46.0" ) ]
167
167
#[ rustc_const_stable( feature = "leading_trailing_ones" , since = "1.46.0" ) ]
168
- #[ inline]
168
+ #[ inline( always ) ]
169
169
pub const fn trailing_ones( self ) -> u32 {
170
170
( self as $UnsignedT) . trailing_ones( )
171
171
}
@@ -189,7 +189,7 @@ macro_rules! int_impl {
189
189
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
190
190
#[ must_use = "this returns the result of the operation, \
191
191
without modifying the original"]
192
- #[ inline]
192
+ #[ inline( always ) ]
193
193
pub const fn rotate_left( self , n: u32 ) -> Self {
194
194
( self as $UnsignedT) . rotate_left( n) as Self
195
195
}
@@ -214,7 +214,7 @@ macro_rules! int_impl {
214
214
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
215
215
#[ must_use = "this returns the result of the operation, \
216
216
without modifying the original"]
217
- #[ inline]
217
+ #[ inline( always ) ]
218
218
pub const fn rotate_right( self , n: u32 ) -> Self {
219
219
( self as $UnsignedT) . rotate_right( n) as Self
220
220
}
@@ -234,7 +234,7 @@ macro_rules! int_impl {
234
234
/// ```
235
235
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
236
236
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
237
- #[ inline]
237
+ #[ inline( always ) ]
238
238
pub const fn swap_bytes( self ) -> Self {
239
239
( self as $UnsignedT) . swap_bytes( ) as Self
240
240
}
@@ -255,7 +255,7 @@ macro_rules! int_impl {
255
255
/// ```
256
256
#[ stable( feature = "reverse_bits" , since = "1.37.0" ) ]
257
257
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
258
- #[ inline]
258
+ #[ inline( always ) ]
259
259
#[ must_use]
260
260
pub const fn reverse_bits( self ) -> Self {
261
261
( self as $UnsignedT) . reverse_bits( ) as Self
@@ -416,7 +416,7 @@ macro_rules! int_impl {
416
416
) ]
417
417
#[ must_use = "this returns the result of the operation, \
418
418
without modifying the original"]
419
- #[ inline]
419
+ #[ inline( always ) ]
420
420
pub unsafe fn unchecked_add( self , rhs: Self ) -> Self {
421
421
// SAFETY: the caller must uphold the safety contract for
422
422
// `unchecked_add`.
@@ -454,7 +454,7 @@ macro_rules! int_impl {
454
454
) ]
455
455
#[ must_use = "this returns the result of the operation, \
456
456
without modifying the original"]
457
- #[ inline]
457
+ #[ inline( always ) ]
458
458
pub unsafe fn unchecked_sub( self , rhs: Self ) -> Self {
459
459
// SAFETY: the caller must uphold the safety contract for
460
460
// `unchecked_sub`.
@@ -492,7 +492,7 @@ macro_rules! int_impl {
492
492
) ]
493
493
#[ must_use = "this returns the result of the operation, \
494
494
without modifying the original"]
495
- #[ inline]
495
+ #[ inline( always ) ]
496
496
pub unsafe fn unchecked_mul( self , rhs: Self ) -> Self {
497
497
// SAFETY: the caller must uphold the safety contract for
498
498
// `unchecked_mul`.
@@ -741,7 +741,7 @@ macro_rules! int_impl {
741
741
#[ rustc_const_stable( feature = "const_saturating_int_methods" , since = "1.47.0" ) ]
742
742
#[ must_use = "this returns the result of the operation, \
743
743
without modifying the original"]
744
- #[ inline]
744
+ #[ inline( always ) ]
745
745
pub const fn saturating_add( self , rhs: Self ) -> Self {
746
746
intrinsics:: saturating_add( self , rhs)
747
747
}
@@ -762,7 +762,7 @@ macro_rules! int_impl {
762
762
#[ rustc_const_stable( feature = "const_saturating_int_methods" , since = "1.47.0" ) ]
763
763
#[ must_use = "this returns the result of the operation, \
764
764
without modifying the original"]
765
- #[ inline]
765
+ #[ inline( always ) ]
766
766
pub const fn saturating_sub( self , rhs: Self ) -> Self {
767
767
intrinsics:: saturating_sub( self , rhs)
768
768
}
@@ -783,7 +783,7 @@ macro_rules! int_impl {
783
783
784
784
#[ stable( feature = "saturating_neg" , since = "1.45.0" ) ]
785
785
#[ rustc_const_stable( feature = "const_saturating_int_methods" , since = "1.47.0" ) ]
786
- #[ inline]
786
+ #[ inline( always ) ]
787
787
pub const fn saturating_neg( self ) -> Self {
788
788
intrinsics:: saturating_sub( 0 , self )
789
789
}
@@ -883,7 +883,7 @@ macro_rules! int_impl {
883
883
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
884
884
#[ must_use = "this returns the result of the operation, \
885
885
without modifying the original"]
886
- #[ inline]
886
+ #[ inline( always ) ]
887
887
pub const fn wrapping_add( self , rhs: Self ) -> Self {
888
888
intrinsics:: wrapping_add( self , rhs)
889
889
}
@@ -903,7 +903,7 @@ macro_rules! int_impl {
903
903
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
904
904
#[ must_use = "this returns the result of the operation, \
905
905
without modifying the original"]
906
- #[ inline]
906
+ #[ inline( always ) ]
907
907
pub const fn wrapping_sub( self , rhs: Self ) -> Self {
908
908
intrinsics:: wrapping_sub( self , rhs)
909
909
}
@@ -923,7 +923,7 @@ macro_rules! int_impl {
923
923
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
924
924
#[ must_use = "this returns the result of the operation, \
925
925
without modifying the original"]
926
- #[ inline]
926
+ #[ inline( always ) ]
927
927
pub const fn wrapping_mul( self , rhs: Self ) -> Self {
928
928
intrinsics:: wrapping_mul( self , rhs)
929
929
}
@@ -1081,7 +1081,7 @@ macro_rules! int_impl {
1081
1081
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
1082
1082
#[ must_use = "this returns the result of the operation, \
1083
1083
without modifying the original"]
1084
- #[ inline]
1084
+ #[ inline( always ) ]
1085
1085
pub const fn wrapping_shl( self , rhs: u32 ) -> Self {
1086
1086
// SAFETY: the masking by the bitsize of the type ensures that we do not shift
1087
1087
// out of bounds
@@ -1110,7 +1110,7 @@ macro_rules! int_impl {
1110
1110
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
1111
1111
#[ must_use = "this returns the result of the operation, \
1112
1112
without modifying the original"]
1113
- #[ inline]
1113
+ #[ inline( always ) ]
1114
1114
pub const fn wrapping_shr( self , rhs: u32 ) -> Self {
1115
1115
// SAFETY: the masking by the bitsize of the type ensures that we do not shift
1116
1116
// out of bounds
@@ -1225,7 +1225,7 @@ macro_rules! int_impl {
1225
1225
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
1226
1226
#[ must_use = "this returns the result of the operation, \
1227
1227
without modifying the original"]
1228
- #[ inline]
1228
+ #[ inline( always ) ]
1229
1229
pub const fn overflowing_add( self , rhs: Self ) -> ( Self , bool ) {
1230
1230
let ( a, b) = intrinsics:: add_with_overflow( self as $ActualT, rhs as $ActualT) ;
1231
1231
( a as Self , b)
@@ -1249,7 +1249,7 @@ macro_rules! int_impl {
1249
1249
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
1250
1250
#[ must_use = "this returns the result of the operation, \
1251
1251
without modifying the original"]
1252
- #[ inline]
1252
+ #[ inline( always ) ]
1253
1253
pub const fn overflowing_sub( self , rhs: Self ) -> ( Self , bool ) {
1254
1254
let ( a, b) = intrinsics:: sub_with_overflow( self as $ActualT, rhs as $ActualT) ;
1255
1255
( a as Self , b)
@@ -1272,7 +1272,7 @@ macro_rules! int_impl {
1272
1272
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
1273
1273
#[ must_use = "this returns the result of the operation, \
1274
1274
without modifying the original"]
1275
- #[ inline]
1275
+ #[ inline( always ) ]
1276
1276
pub const fn overflowing_mul( self , rhs: Self ) -> ( Self , bool ) {
1277
1277
let ( a, b) = intrinsics:: mul_with_overflow( self as $ActualT, rhs as $ActualT) ;
1278
1278
( a as Self , b)
@@ -1725,7 +1725,7 @@ macro_rules! int_impl {
1725
1725
/// ```
1726
1726
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1727
1727
#[ rustc_const_stable( feature = "const_int_sign" , since = "1.47.0" ) ]
1728
- #[ inline]
1728
+ #[ inline( always ) ]
1729
1729
pub const fn signum( self ) -> Self {
1730
1730
match self {
1731
1731
n if n > 0 => 1 ,
@@ -1747,7 +1747,7 @@ macro_rules! int_impl {
1747
1747
/// ```
1748
1748
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1749
1749
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
1750
- #[ inline]
1750
+ #[ inline( always ) ]
1751
1751
pub const fn is_positive( self ) -> bool { self > 0 }
1752
1752
1753
1753
/// Returns `true` if `self` is negative and `false` if the number is zero or
@@ -1763,7 +1763,7 @@ macro_rules! int_impl {
1763
1763
/// ```
1764
1764
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1765
1765
#[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
1766
- #[ inline]
1766
+ #[ inline( always ) ]
1767
1767
pub const fn is_negative( self ) -> bool { self < 0 }
1768
1768
1769
1769
/// Return the memory representation of this integer as a byte array in
0 commit comments