@@ -63,7 +63,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
63
63
break_scope,
64
64
variable_source_info,
65
65
declare_bindings,
66
- match cold_branch { Some ( false ) => Some ( false ) , _ => None } ,
66
+ match cold_branch {
67
+ Some ( false ) => Some ( false ) ,
68
+ _ => None ,
69
+ } ,
67
70
) ) ;
68
71
69
72
let rhs_then_block = unpack ! ( this. then_else_break(
@@ -89,7 +92,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
89
92
local_scope,
90
93
variable_source_info,
91
94
true ,
92
- match cold_branch { Some ( true ) => Some ( true ) , _ => None } ,
95
+ match cold_branch {
96
+ Some ( true ) => Some ( true ) ,
97
+ _ => None ,
98
+ } ,
93
99
)
94
100
} ) ;
95
101
let rhs_success_block = unpack ! ( this. then_else_break(
@@ -167,12 +173,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
167
173
168
174
let then_block = this. cfg . start_new_block ( ) ;
169
175
let else_block = this. cfg . start_new_block ( ) ;
170
- let term = TerminatorKind :: if_with_cold_br (
171
- operand,
172
- then_block,
173
- else_block,
174
- cold_branch
175
- ) ;
176
+ let term =
177
+ TerminatorKind :: if_with_cold_br ( operand, then_block, else_block, cold_branch) ;
176
178
177
179
let source_info = this. source_info ( expr_span) ;
178
180
this. cfg . terminate ( block, source_info, term) ;
@@ -307,8 +309,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
307
309
let arm = & self . thir [ arm] ;
308
310
let arm_has_guard = arm. guard . is_some ( ) ;
309
311
let arm_is_cold = arm. is_cold ;
310
- let arm_candidate =
311
- Candidate :: new ( scrutinee. clone ( ) , & arm. pattern , arm_has_guard, arm_is_cold, self ) ;
312
+ let arm_candidate = Candidate :: new (
313
+ scrutinee. clone ( ) ,
314
+ & arm. pattern ,
315
+ arm_has_guard,
316
+ arm_is_cold,
317
+ self ,
318
+ ) ;
312
319
( arm, arm_candidate)
313
320
} )
314
321
. collect ( )
@@ -667,7 +674,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
667
674
initializer : PlaceBuilder < ' tcx > ,
668
675
set_match_place : bool ,
669
676
) -> BlockAnd < ( ) > {
670
- let mut candidate = Candidate :: new ( initializer. clone ( ) , irrefutable_pat, false , false , self ) ;
677
+ let mut candidate =
678
+ Candidate :: new ( initializer. clone ( ) , irrefutable_pat, false , false , self ) ;
671
679
let fake_borrow_temps = self . lower_match_tree (
672
680
block,
673
681
irrefutable_pat. span ,
@@ -1520,7 +1528,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
1520
1528
debug ! ( "candidate={:#?}\n pats={:#?}" , candidate, pats) ;
1521
1529
let mut or_candidates: Vec < _ > = pats
1522
1530
. iter ( )
1523
- . map ( |pat| Candidate :: new ( place. clone ( ) , pat, candidate. has_guard , candidate. is_cold , self ) )
1531
+ . map ( |pat| {
1532
+ Candidate :: new ( place. clone ( ) , pat, candidate. has_guard , candidate. is_cold , self )
1533
+ } )
1524
1534
. collect ( ) ;
1525
1535
let mut or_candidate_refs: Vec < _ > = or_candidates. iter_mut ( ) . collect ( ) ;
1526
1536
let otherwise = if candidate. otherwise_block . is_some ( ) {
@@ -1771,10 +1781,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
1771
1781
// Find cold targets.
1772
1782
let mut cold_targets: ThinVec < usize > = ThinVec :: new ( ) ;
1773
1783
1774
- let is_otherwise_target_cold =
1775
- candidates. len ( ) > 0 &&
1776
- candidates. iter ( ) . all ( |c| c. is_cold ) ; // && c.match_pairs.is_empty());
1777
- if is_otherwise_target_cold {
1784
+ let is_otherwise_target_cold = candidates. len ( ) > 0 && candidates. iter ( ) . all ( |c| c. is_cold ) ;
1785
+ if is_otherwise_target_cold {
1778
1786
cold_targets. push ( target_candidates. len ( ) ) ;
1779
1787
}
1780
1788
@@ -1849,7 +1857,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
1849
1857
& match_place,
1850
1858
& test,
1851
1859
target_blocks,
1852
- cold_targets
1860
+ cold_targets,
1853
1861
) ;
1854
1862
}
1855
1863
@@ -1948,7 +1956,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
1948
1956
let expr_span = self . thir [ expr_id] . span ;
1949
1957
let expr_place_builder = unpack ! ( block = self . lower_scrutinee( block, expr_id, expr_span) ) ;
1950
1958
let wildcard = Pat :: wildcard_from_ty ( pat. ty ) ;
1951
- let mut guard_candidate = Candidate :: new ( expr_place_builder. clone ( ) , pat, false , false , self ) ;
1959
+ let mut guard_candidate =
1960
+ Candidate :: new ( expr_place_builder. clone ( ) , pat, false , false , self ) ;
1952
1961
let mut otherwise_candidate =
1953
1962
Candidate :: new ( expr_place_builder. clone ( ) , & wildcard, false , false , self ) ;
1954
1963
let fake_borrow_temps = self . lower_match_tree (
0 commit comments