File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed
compiler/rustc_mir_build/src/thir/pattern Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -140,20 +140,17 @@ impl IntRange {
140140 value : mir:: ConstantKind < ' tcx > ,
141141 ) -> Option < IntRange > {
142142 let ty = value. ty ( ) ;
143- if let Some ( ( target_size, bias) ) = Self :: integral_size_and_signed_bias ( tcx, ty) {
144- let val = match value {
145- mir:: ConstantKind :: Ty ( c) if let ty:: ConstKind :: Value ( valtree) = c. kind ( ) => {
146- valtree. unwrap_leaf ( ) . to_bits ( target_size) . ok ( )
147- } ,
148- // This is a more general form of the previous case.
149- _ => value. try_eval_bits ( tcx, param_env, ty) ,
150- } ?;
143+ let ( target_size, bias) = Self :: integral_size_and_signed_bias ( tcx, ty) ? ;
144+ let val = match value {
145+ mir:: ConstantKind :: Ty ( c) if let ty:: ConstKind :: Value ( valtree) = c. kind ( ) => {
146+ valtree. unwrap_leaf ( ) . to_bits ( target_size) . ok ( )
147+ } ,
148+ // This is a more general form of the previous case.
149+ _ => value. try_eval_bits ( tcx, param_env, ty) ,
150+ } ?;
151151
152- let val = val ^ bias;
153- Some ( IntRange { range : val..=val, bias } )
154- } else {
155- None
156- }
152+ let val = val ^ bias;
153+ Some ( IntRange { range : val..=val, bias } )
157154 }
158155
159156 #[ inline]
You can’t perform that action at this time.
0 commit comments