@@ -1946,18 +1946,18 @@ fn detect_extreme_expr<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr<'_
1946
1946
let which = match ( & ty. kind , cv) {
1947
1947
( & ty:: Bool , Constant :: Bool ( false ) ) | ( & ty:: Uint ( _) , Constant :: Int ( 0 ) ) => Minimum ,
1948
1948
( & ty:: Int ( ity) , Constant :: Int ( i) )
1949
- if i == unsext ( cx. tcx , i128:: min_value ( ) >> ( 128 - int_bits ( cx. tcx , ity) ) , ity) =>
1949
+ if i == unsext ( cx. tcx , i128:: MIN >> ( 128 - int_bits ( cx. tcx , ity) ) , ity) =>
1950
1950
{
1951
1951
Minimum
1952
1952
} ,
1953
1953
1954
1954
( & ty:: Bool , Constant :: Bool ( true ) ) => Maximum ,
1955
1955
( & ty:: Int ( ity) , Constant :: Int ( i) )
1956
- if i == unsext ( cx. tcx , i128:: max_value ( ) >> ( 128 - int_bits ( cx. tcx , ity) ) , ity) =>
1956
+ if i == unsext ( cx. tcx , i128:: MAX >> ( 128 - int_bits ( cx. tcx , ity) ) , ity) =>
1957
1957
{
1958
1958
Maximum
1959
1959
} ,
1960
- ( & ty:: Uint ( uty) , Constant :: Int ( i) ) if clip ( cx. tcx , u128:: max_value ( ) , uty) == i => Maximum ,
1960
+ ( & ty:: Uint ( uty) , Constant :: Int ( i) ) if clip ( cx. tcx , u128:: MAX , uty) == i => Maximum ,
1961
1961
1962
1962
_ => return None ,
1963
1963
} ;
@@ -2039,7 +2039,7 @@ impl FullInt {
2039
2039
fn cmp_s_u ( s : i128 , u : u128 ) -> Ordering {
2040
2040
if s < 0 {
2041
2041
Ordering :: Less
2042
- } else if u > ( i128:: max_value ( ) as u128 ) {
2042
+ } else if u > ( i128:: MAX as u128 ) {
2043
2043
Ordering :: Greater
2044
2044
} else {
2045
2045
( s as u128 ) . cmp ( & u)
@@ -2084,48 +2084,48 @@ fn numeric_cast_precast_bounds<'a>(cx: &LateContext<'_, '_>, expr: &'a Expr<'_>)
2084
2084
match pre_cast_ty. kind {
2085
2085
ty:: Int ( int_ty) => Some ( match int_ty {
2086
2086
IntTy :: I8 => (
2087
- FullInt :: S ( i128:: from ( i8:: min_value ( ) ) ) ,
2088
- FullInt :: S ( i128:: from ( i8:: max_value ( ) ) ) ,
2087
+ FullInt :: S ( i128:: from ( i8:: MIN ) ) ,
2088
+ FullInt :: S ( i128:: from ( i8:: MAX ) ) ,
2089
2089
) ,
2090
2090
IntTy :: I16 => (
2091
- FullInt :: S ( i128:: from ( i16:: min_value ( ) ) ) ,
2092
- FullInt :: S ( i128:: from ( i16:: max_value ( ) ) ) ,
2091
+ FullInt :: S ( i128:: from ( i16:: MIN ) ) ,
2092
+ FullInt :: S ( i128:: from ( i16:: MAX ) ) ,
2093
2093
) ,
2094
2094
IntTy :: I32 => (
2095
- FullInt :: S ( i128:: from ( i32:: min_value ( ) ) ) ,
2096
- FullInt :: S ( i128:: from ( i32:: max_value ( ) ) ) ,
2095
+ FullInt :: S ( i128:: from ( i32:: MIN ) ) ,
2096
+ FullInt :: S ( i128:: from ( i32:: MAX ) ) ,
2097
2097
) ,
2098
2098
IntTy :: I64 => (
2099
- FullInt :: S ( i128:: from ( i64:: min_value ( ) ) ) ,
2100
- FullInt :: S ( i128:: from ( i64:: max_value ( ) ) ) ,
2099
+ FullInt :: S ( i128:: from ( i64:: MIN ) ) ,
2100
+ FullInt :: S ( i128:: from ( i64:: MAX ) ) ,
2101
2101
) ,
2102
- IntTy :: I128 => ( FullInt :: S ( i128:: min_value ( ) ) , FullInt :: S ( i128:: max_value ( ) ) ) ,
2102
+ IntTy :: I128 => ( FullInt :: S ( i128:: MIN ) , FullInt :: S ( i128:: MAX ) ) ,
2103
2103
IntTy :: Isize => (
2104
- FullInt :: S ( isize:: min_value ( ) as i128 ) ,
2105
- FullInt :: S ( isize:: max_value ( ) as i128 ) ,
2104
+ FullInt :: S ( isize:: MIN as i128 ) ,
2105
+ FullInt :: S ( isize:: MAX as i128 ) ,
2106
2106
) ,
2107
2107
} ) ,
2108
2108
ty:: Uint ( uint_ty) => Some ( match uint_ty {
2109
2109
UintTy :: U8 => (
2110
- FullInt :: U ( u128:: from ( u8:: min_value ( ) ) ) ,
2111
- FullInt :: U ( u128:: from ( u8:: max_value ( ) ) ) ,
2110
+ FullInt :: U ( u128:: from ( u8:: MIN ) ) ,
2111
+ FullInt :: U ( u128:: from ( u8:: MAX ) ) ,
2112
2112
) ,
2113
2113
UintTy :: U16 => (
2114
- FullInt :: U ( u128:: from ( u16:: min_value ( ) ) ) ,
2115
- FullInt :: U ( u128:: from ( u16:: max_value ( ) ) ) ,
2114
+ FullInt :: U ( u128:: from ( u16:: MIN ) ) ,
2115
+ FullInt :: U ( u128:: from ( u16:: MAX ) ) ,
2116
2116
) ,
2117
2117
UintTy :: U32 => (
2118
- FullInt :: U ( u128:: from ( u32:: min_value ( ) ) ) ,
2119
- FullInt :: U ( u128:: from ( u32:: max_value ( ) ) ) ,
2118
+ FullInt :: U ( u128:: from ( u32:: MIN ) ) ,
2119
+ FullInt :: U ( u128:: from ( u32:: MAX ) ) ,
2120
2120
) ,
2121
2121
UintTy :: U64 => (
2122
- FullInt :: U ( u128:: from ( u64:: min_value ( ) ) ) ,
2123
- FullInt :: U ( u128:: from ( u64:: max_value ( ) ) ) ,
2122
+ FullInt :: U ( u128:: from ( u64:: MIN ) ) ,
2123
+ FullInt :: U ( u128:: from ( u64:: MAX ) ) ,
2124
2124
) ,
2125
- UintTy :: U128 => ( FullInt :: U ( u128:: min_value ( ) ) , FullInt :: U ( u128:: max_value ( ) ) ) ,
2125
+ UintTy :: U128 => ( FullInt :: U ( u128:: MIN ) , FullInt :: U ( u128:: MAX ) ) ,
2126
2126
UintTy :: Usize => (
2127
- FullInt :: U ( usize:: min_value ( ) as u128 ) ,
2128
- FullInt :: U ( usize:: max_value ( ) as u128 ) ,
2127
+ FullInt :: U ( usize:: MIN as u128 ) ,
2128
+ FullInt :: U ( usize:: MAX as u128 ) ,
2129
2129
) ,
2130
2130
} ) ,
2131
2131
_ => None ,
0 commit comments