@@ -33,27 +33,25 @@ fn all_ranges<'tcx>(cx: &LateContext<'tcx>, arms: &'tcx [Arm<'_>], ty: Ty<'tcx>)
3333 . filter_map ( |arm| {
3434 if let Arm { pat, guard : None , .. } = * arm {
3535 if let PatKind :: Range ( ref lhs, ref rhs, range_end) = pat. kind {
36- let lhs_const = match lhs {
37- Some ( lhs) => constant ( cx, cx. typeck_results ( ) , lhs) ?,
38- None => {
39- let min_val_const = ty. numeric_min_val ( cx. tcx ) ?;
40- let min_constant = mir:: ConstantKind :: from_value (
41- cx. tcx . valtree_to_const_val ( ( ty, min_val_const. to_valtree ( ) ) ) ,
42- ty,
43- ) ;
44- miri_to_const ( cx, min_constant) ?
45- } ,
36+ let lhs_const = if let Some ( lhs) = lhs {
37+ constant ( cx, cx. typeck_results ( ) , lhs) ?
38+ } else {
39+ let min_val_const = ty. numeric_min_val ( cx. tcx ) ?;
40+ let min_constant = mir:: ConstantKind :: from_value (
41+ cx. tcx . valtree_to_const_val ( ( ty, min_val_const. to_valtree ( ) ) ) ,
42+ ty,
43+ ) ;
44+ miri_to_const ( cx, min_constant) ?
4645 } ;
47- let rhs_const = match rhs {
48- Some ( rhs) => constant ( cx, cx. typeck_results ( ) , rhs) ?,
49- None => {
50- let max_val_const = ty. numeric_max_val ( cx. tcx ) ?;
51- let max_constant = mir:: ConstantKind :: from_value (
52- cx. tcx . valtree_to_const_val ( ( ty, max_val_const. to_valtree ( ) ) ) ,
53- ty,
54- ) ;
55- miri_to_const ( cx, max_constant) ?
56- } ,
46+ let rhs_const = if let Some ( rhs) = rhs {
47+ constant ( cx, cx. typeck_results ( ) , rhs) ?
48+ } else {
49+ let max_val_const = ty. numeric_max_val ( cx. tcx ) ?;
50+ let max_constant = mir:: ConstantKind :: from_value (
51+ cx. tcx . valtree_to_const_val ( ( ty, max_val_const. to_valtree ( ) ) ) ,
52+ ty,
53+ ) ;
54+ miri_to_const ( cx, max_constant) ?
5755 } ;
5856 let lhs_val = lhs_const. int_value ( cx, ty) ?;
5957 let rhs_val = rhs_const. int_value ( cx, ty) ?;
0 commit comments