@@ -141,23 +141,22 @@ impl IntRange {
141
141
) -> Option < IntRange > {
142
142
let ty = value. ty ( ) ;
143
143
if let Some ( ( target_size, bias) ) = Self :: integral_size_and_signed_bias ( tcx, ty) {
144
- let val =
145
- if let mir:: ConstantKind :: Val ( ConstValue :: Scalar ( scalar) , _) = value {
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
- } else {
152
- if let mir:: ConstantKind :: Ty ( c) = value
153
- && let ty:: ConstKind :: Value ( _) = c. kind ( )
154
- {
155
- bug ! ( "encountered ConstValue in mir::ConstantKind::Ty, whereas this is expected to be in ConstantKind::Val" ) ;
156
- }
144
+ let val = if let mir:: ConstantKind :: Val ( ConstValue :: Scalar ( scalar) , _) = value {
145
+ // For this specific pattern we can skip a lot of effort and go
146
+ // straight to the result, after doing a bit of checking. (We
147
+ // could remove this branch and just fall through, which
148
+ // is more general but much slower.)
149
+ scalar. to_bits_or_ptr_internal ( target_size) . unwrap ( ) . left ( ) ?
150
+ } else {
151
+ if let mir:: ConstantKind :: Ty ( c) = value
152
+ && let ty:: ConstKind :: Value ( _) = c. kind ( )
153
+ {
154
+ bug ! ( "encountered ConstValue in mir::ConstantKind::Ty, whereas this is expected to be in ConstantKind::Val" ) ;
155
+ }
157
156
158
- // This is a more general form of the previous case.
159
- value. try_eval_bits ( tcx, param_env, ty) ?
160
- } ;
157
+ // This is a more general form of the previous case.
158
+ value. try_eval_bits ( tcx, param_env, ty) ?
159
+ } ;
161
160
let val = val ^ bias;
162
161
Some ( IntRange { range : val..=val, bias } )
163
162
} else {
0 commit comments