@@ -53,11 +53,11 @@ use smallvec::{smallvec, SmallVec};
53
53
use rustc_data_structures:: captures:: Captures ;
54
54
use rustc_hir:: { HirId , RangeEnd } ;
55
55
use rustc_index:: Idx ;
56
+ use rustc_middle:: middle:: stability:: EvalResult ;
56
57
use rustc_middle:: mir;
57
58
use rustc_middle:: thir:: { FieldPat , Pat , PatKind , PatRange } ;
58
59
use rustc_middle:: ty:: layout:: IntegerExt ;
59
60
use rustc_middle:: ty:: { self , Ty , TyCtxt , VariantDef } ;
60
- use rustc_middle:: { middle:: stability:: EvalResult , mir:: interpret:: ConstValue } ;
61
61
use rustc_session:: lint;
62
62
use rustc_span:: { Span , DUMMY_SP } ;
63
63
use rustc_target:: abi:: { FieldIdx , Integer , Size , VariantIdx , FIRST_VARIANT } ;
@@ -142,13 +142,6 @@ impl IntRange {
142
142
let ty = value. ty ( ) ;
143
143
if let Some ( ( target_size, bias) ) = Self :: integral_size_and_signed_bias ( tcx, ty) {
144
144
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
- }
152
145
mir:: ConstantKind :: Ty ( c) if let ty:: ConstKind :: Value ( valtree) = c. kind ( ) => {
153
146
valtree. unwrap_leaf ( ) . to_bits ( target_size) . ok ( )
154
147
} ,
0 commit comments