This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
compiler/rustc_middle/src Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -941,6 +941,13 @@ impl<'tcx> PatRangeBoundary<'tcx> {
941
941
param_env : ty:: ParamEnv < ' tcx > ,
942
942
) -> u128 {
943
943
match self {
944
+ Self :: Finite {
945
+ value : mir:: Const :: Val ( mir:: ConstValue :: Scalar ( Scalar :: Int ( scalar_int) ) , _) ,
946
+ } => scalar_int. assert_bits ( scalar_int. size ( ) ) ,
947
+ Self :: Finite {
948
+ value : mir:: Const :: Ty ( c) ,
949
+ } if let ty:: ConstKind :: Value ( ty:: ValTree :: Leaf ( scalar_int) ) = c. kind ( )
950
+ => scalar_int. assert_bits ( scalar_int. size ( ) ) ,
944
951
Self :: Finite { value } => value. eval_bits ( tcx, param_env) ,
945
952
// Self::NegInfinity => {
946
953
// // Unwrap is ok because the type is known to be numeric.
@@ -977,10 +984,6 @@ impl<'tcx> PatRangeBoundary<'tcx> {
977
984
{
978
985
return Some ( a. kind ( ) . cmp ( & b. kind ( ) ) ) ;
979
986
}
980
- (
981
- Finite { value : mir:: Const :: Val ( mir:: ConstValue :: Scalar ( Scalar :: Int ( a) ) , _) } ,
982
- Finite { value : mir:: Const :: Val ( mir:: ConstValue :: Scalar ( Scalar :: Int ( b) ) , _) } ,
983
- ) if matches ! ( ty. kind( ) , ty:: Uint ( _) | ty:: Char ) => return Some ( a. cmp ( & b) ) ,
984
987
_ => { }
985
988
}
986
989
You can’t perform that action at this time.
0 commit comments