@@ -124,15 +124,15 @@ macro_rules! int_impl {
124
124
/// Returns the smallest value that can be represented by this integer type.
125
125
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
126
126
#[ inline]
127
- pub fn min_value( ) -> Self {
127
+ pub const fn min_value( ) -> Self {
128
128
( -1 as Self ) << ( $BITS - 1 )
129
129
}
130
130
131
131
/// Returns the largest value that can be represented by this integer type.
132
132
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
133
133
#[ inline]
134
- pub fn max_value( ) -> Self {
135
- let min = Self :: min_value( ) ; !min
134
+ pub const fn max_value( ) -> Self {
135
+ ! Self :: min_value( )
136
136
}
137
137
138
138
/// Converts a string slice in a given base to an integer.
@@ -891,12 +891,12 @@ macro_rules! uint_impl {
891
891
/// Returns the smallest value that can be represented by this integer type.
892
892
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
893
893
#[ inline]
894
- pub fn min_value( ) -> Self { 0 }
894
+ pub const fn min_value( ) -> Self { 0 }
895
895
896
896
/// Returns the largest value that can be represented by this integer type.
897
897
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
898
898
#[ inline]
899
- pub fn max_value( ) -> Self { !0 }
899
+ pub const fn max_value( ) -> Self { !0 }
900
900
901
901
/// Converts a string slice in a given base to an integer.
902
902
///
0 commit comments