@@ -16,7 +16,7 @@ use rustc_hir::{BindingAnnotation, ByRef, HirId, MatchSource, RangeEnd};
1616use rustc_index:: newtype_index;
1717use rustc_index:: IndexVec ;
1818use rustc_middle:: middle:: region;
19- use rustc_middle:: mir:: interpret:: { AllocId , Scalar } ;
19+ use rustc_middle:: mir:: interpret:: AllocId ;
2020use rustc_middle:: mir:: { self , BinOp , BorrowKind , FakeReadCause , UnOp } ;
2121use rustc_middle:: ty:: adjustment:: PointerCoercion ;
2222use rustc_middle:: ty:: layout:: IntegerExt ;
@@ -1013,12 +1013,12 @@ impl<'tcx> PatRangeBoundary<'tcx> {
10131013 // many ranges such as '\u{037A}'..='\u{037F}', and chars can be compared
10141014 // in this way.
10151015 ( Finite ( a) , Finite ( b) ) if matches ! ( ty. kind( ) , ty:: Uint ( _) | ty:: Char ) => {
1016- let to_scalar_int = |x| match x {
1016+ /* let to_scalar_int = |x| match x {
10171017 mir::Const::Val(mir::ConstValue::Scalar(Scalar::Int(x)), _) => Some(x),
10181018 mir::Const::Ty(x) => Some(x.to_valtree().unwrap_leaf()),
10191019 _ => None,
1020- } ;
1021- if let ( Some ( a) , Some ( b) ) = ( to_scalar_int ( a ) , to_scalar_int ( b ) ) {
1020+ };*/
1021+ if let ( Some ( a) , Some ( b) ) = ( a . try_to_scalar_int ( ) , b . try_to_scalar_int ( ) ) {
10221022 let sz = ty. primitive_size ( tcx) ;
10231023 let a = a. assert_uint ( sz) ;
10241024 let b = b. assert_uint ( sz) ;
0 commit comments