@@ -53,11 +53,11 @@ use smallvec::{smallvec, SmallVec};
5353use rustc_data_structures:: captures:: Captures ;
5454use rustc_hir:: { HirId , RangeEnd } ;
5555use rustc_index:: Idx ;
56+ use rustc_middle:: middle:: stability:: EvalResult ;
5657use rustc_middle:: mir;
5758use rustc_middle:: thir:: { FieldPat , Pat , PatKind , PatRange } ;
5859use rustc_middle:: ty:: layout:: IntegerExt ;
5960use rustc_middle:: ty:: { self , Ty , TyCtxt , VariantDef } ;
60- use rustc_middle:: { middle:: stability:: EvalResult , mir:: interpret:: ConstValue } ;
6161use rustc_session:: lint;
6262use rustc_span:: { Span , DUMMY_SP } ;
6363use rustc_target:: abi:: { FieldIdx , Integer , Size , VariantIdx , FIRST_VARIANT } ;
@@ -142,13 +142,6 @@ impl IntRange {
142142 let ty = value. ty ( ) ;
143143 if let Some ( ( target_size, bias) ) = Self :: integral_size_and_signed_bias ( tcx, ty) {
144144 let val = match value {
145- mir:: ConstantKind :: Val ( ConstValue :: Scalar ( scalar) , _) => {
146- // For this specific pattern we can skip a lot of effort and go
147- // straight to the result, after doing a bit of checking. (We
148- // could remove this branch and just fall through, which
149- // is more general but much slower.)
150- scalar. to_bits_or_ptr_internal ( target_size) . unwrap ( ) . left ( )
151- }
152145 mir:: ConstantKind :: Ty ( c) if let ty:: ConstKind :: Value ( valtree) = c. kind ( ) => {
153146 valtree. unwrap_leaf ( ) . to_bits ( target_size) . ok ( )
154147 } ,
0 commit comments