@@ -16,7 +16,7 @@ use rustc_hir::{BindingAnnotation, ByRef, HirId, MatchSource, RangeEnd};
16
16
use rustc_index:: newtype_index;
17
17
use rustc_index:: IndexVec ;
18
18
use rustc_middle:: middle:: region;
19
- use rustc_middle:: mir:: interpret:: { AllocId , Scalar } ;
19
+ use rustc_middle:: mir:: interpret:: AllocId ;
20
20
use rustc_middle:: mir:: { self , BinOp , BorrowKind , FakeReadCause , UnOp } ;
21
21
use rustc_middle:: ty:: adjustment:: PointerCoercion ;
22
22
use rustc_middle:: ty:: layout:: IntegerExt ;
@@ -1013,12 +1013,12 @@ impl<'tcx> PatRangeBoundary<'tcx> {
1013
1013
// many ranges such as '\u{037A}'..='\u{037F}', and chars can be compared
1014
1014
// in this way.
1015
1015
( 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 {
1017
1017
mir::Const::Val(mir::ConstValue::Scalar(Scalar::Int(x)), _) => Some(x),
1018
1018
mir::Const::Ty(x) => Some(x.to_valtree().unwrap_leaf()),
1019
1019
_ => 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 ( ) ) {
1022
1022
let sz = ty. primitive_size ( tcx) ;
1023
1023
let a = a. assert_uint ( sz) ;
1024
1024
let b = b. assert_uint ( sz) ;
0 commit comments